Thread Tools Display Modes
02-05-09, 03:17 PM   #1
Felankor
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 26
Question Portrait dropdown help

Hi,

Something changed in 3.0.8 which is causing an error in my addon. I can't fix it because I can't find what has changed.

I'm getting the following error:
Code:
attempt to index local 'dropdownFrame' (a nil value)
Heres the code:
Code:
local dropdownFrame = getglobal(UIDROPDOWNMENU_INIT_MENU);
local name = dropdownFrame.name; --<<<<<< This is the line with the error
local button = this.value;
Can anyone tell me how to fix it, or atleast what's changed to cause this error so I can try to work out how to fix it myself.

Thanks in advance

Felankor
  Reply With Quote
02-05-09, 04:34 PM   #2
Tuhljin
A Flamescale Wyrmkin
 
Tuhljin's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 106
UIDROPDOWNMENU_INIT_MENU points to the actual frame instead of the frame's name, now. Try this:
Code:
local dropdownFrame = UIDROPDOWNMENU_INIT_MENU;
  Reply With Quote
02-05-09, 05:20 PM   #3
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
this wont work Tuhl this is

Code:
local dropdownFrame = getglobal(UIDROPDOWNMENU_INIT_MENU);
local name = dropdownFrame:GetName()
or

Code:
local name = _G["UIDROPDOWNMENU_INIT_MENU"]:GetName()
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 02-05-09 at 05:26 PM.
  Reply With Quote
02-06-09, 02:52 PM   #4
Felankor
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 26
Thanks for the replies.

Code:
local name = dropdownFrame:GetName()
returns the name of the frame.

Code:
local name = dropdownFrame.name;
returns the name of the target.

However your post still solved my problem so thank you. I got it to work with the following code:

Code:
local dropdownFrame = _G["UIDROPDOWNMENU_INIT_MENU"];
local name = dropdownFrame.name;
Not sure why getglobal didnt work anymore, I'm sure I'm still using it else where in my addon for other things...

Thanks again,

Felankor
  Reply With Quote
02-06-09, 07:43 PM   #5
Tuhljin
A Flamescale Wyrmkin
 
Tuhljin's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 106
Code:
local dropdownFrame = _G["UIDROPDOWNMENU_INIT_MENU"];
==
Code:
local dropdownFrame = UIDROPDOWNMENU_INIT_MENU;
They're the same thing. getglobal doesn't work because, as I said, UIDROPDOWNMENU_INIT_MENU points to the actual frame, not the frame's global name.

Last edited by Tuhljin : 02-06-09 at 07:45 PM.
  Reply With Quote
02-09-09, 11:23 PM   #6
Cyn325
A Theradrim Guardian
 
Cyn325's Avatar
Join Date: Oct 2008
Posts: 65
getglobal doesn't work anymore because of changes Blizzard made with their coding. caused an error with a lot of addons.
  Reply With Quote
02-10-09, 04:43 PM   #7
Tuhljin
A Flamescale Wyrmkin
 
Tuhljin's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 106
Okay, believe whatever you want. Obviously I'm not going to be able to convince you of this, even though it's extremely simple for an addon author to check these things for themselves.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Portrait dropdown help

Thread Tools
Display Modes

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