View Single Post
10-17-16, 05:09 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
This is from the XML you posted:

Code:
<Frame name="QuestGuru" parent="UIParent" ...>
     ...
     <Frames>
         ...
         <Button parentKey="TrackButton" inherits="MagicButtonTemplate" text="TRACK_QUEST_ABBREV">
Based on that, the button's parent is the frame with the global name "QuestGuru" and the button's parentKey is "TrackButton", which means it's available as "QuestGuru.TrackButton".

The only ways that "QuestGuru.TrackButton" can be nil are:

1. The code you posted is not your real code.

2. Some other code (that you didn't post) overrides the "QuestGuru" global with some other object that isn't the frame created by your XML, so there's no longer any global reference to the frame or anything (like the button) attached to it.

Again, this is why you should post your entire, actual code when you're asking for help. It doesn't matter if it's 50 lines or 50,000,000 lines -- we're not going to read through every line, we're going to search for specific parts that are related to the issue at hand. Without being able to do that, all we can do is throw out random guesses that may or may not be useful.

The only difference between 50 lines and 50,000,000 lines is that you should not embed the latter in a forum post; use pastebin or gist for longer pieces of code.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote