Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-27-22, 04:42 PM   #1
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 237
InterfaceOptionsFrame_OpenToCategory not working

Hi all

I am having trouble with InterfaceOptionsFrame_OpenToCategory

I have checked the updated InterfaceOptionsFrame.lua and found the open to category function at line 419

I have not been able to get it working at all.

Here is my frame;
Lua Code:
  1. local NewbDevBoxInterfaceFrame = CreateFrame("Frame", "NewbDevBoxInterfaceFrame", UIParent, "BackdropTemplate")
  2. NewbDevBoxInterfaceFrame.name = "Newb Dev Box"
  3. NewbDevBoxInterfaceFrame:SetBackdrop(
  4.     {
  5.         bgFile = "Interface\\Buttons\\WHITE8X8",
  6.         insets = {
  7.             left = NumberList.insetSize,
  8.             right = NumberList.insetSize,
  9.             top = NumberList.insetSize,
  10.             bottom = NumberList.insetSize
  11.         },
  12.         tileSize = nil,
  13.         tile = false,
  14.         edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
  15.         edgeSize = NumberList.edgeSize
  16.     }
  17. )
  18. NewbDevBoxInterfaceFrame:SetBackdropColor(unpack(TextDimensionList.colourBackdrop))
  19. NewbDevBoxInterfaceFrame:SetBackdropBorderColor(unpack(TextDimensionList.colourBorder))
  20. NewbDevBoxInterfaceFrame:SetScript(
  21.     "OnEvent",
  22.     function(self, event, ...)
  23.         if event == "PLAYER_LOGIN" then -- fires when a player logs in or reloads
  24.             print(TextStringList.addonLoaded) -- Load Message
  25.             initialiseLists()
  26.             setUpNewbDevBoxSortedTable()
  27.             checkOtherAddonsEnabled()
  28.             setCheckBoxesAndButtonFrameMetrics()
  29.             buttonFrameButtonLayout()
  30.         end
  31.     end
  32. )
  33. NewbDevBoxInterfaceFrame:RegisterEvent("PLAYER_LOGIN") -- fires when a player logs in or reloads
  34. NewbDevBoxInterfaceFrame:RegisterEvent("ADDON_LOADED") -- fires when an addon is loaded
  35. InterfaceOptions_AddCategory(NewbDevBoxInterfaceFrame)
My function;
Lua Code:
  1. function NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
  2.     if InterfaceOptionsFrame:IsShown() then
  3.         InterfaceOptionsFrame:Hide()
  4.     else
  5.         InterfaceOptionsFrame_OpenToCategory(NewbDevBoxInterfaceFrame) -- have to do this twice because reasons
  6.         InterfaceOptionsFrame_OpenToCategory(NewbDevBoxInterfaceFrame)
  7.     end
  8. end
And the error;
Lua Code:
  1. 1x Interface/AddOns/NewbDevBox/NewbDevBox.lua:441: attempt to index global 'InterfaceOptionsFrame' (a nil value)
  2.         [string "@Interface/AddOns/NewbDevBox/NewbDevBox.lua"]:441: in function `NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME'
  3.        [string "@Interface/AddOns/NewbDevBox/NewbDevBox.lua"]:1382: in function <Interface/AddOns/NewbDevBox/NewbDevBox.lua:1381>
  4.        
  5.        Locals:
  6.        (*temporary) = nil
  7.        (*temporary) = nil
  8.        (*temporary) = "attempt to index global 'InterfaceOptionsFrame' (a nil value)"
  9.        
  10.  
  11.  
  12.  
  13.        (NewbDevBoxInterfaceFrame)
As you can see the error says that the frame does not exist, yet when I navigate to the addons list I can see and use the category frame without a problem or an error.

I guess something changed with the pre-patch yet I cannot figure out a reason that InterfaceOptionsFrame_OpenToCategory no longer works for me.

Looking for some help with this one.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » InterfaceOptionsFrame_OpenToCategory not working


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off