Thread Tools Display Modes
11-12-16, 12:45 PM   #1
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Order dependent frame methods?

Hi,

I am working on a project where arbitrary frame attributes will be set in an undefined order (hash table), and wonder what attributes need to be set in a certain order for things to work properly.

For example, a parent must be set before anchors are, since an anchor may use the parent. That's the only example I have thought of, so far. I'm only concerned with "attribute" methods, ie anything found in XML, and not things like Show, Raise or SetUserPlaced.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
11-12-16, 01:54 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
Unless a template uses an OnAttributeChanged handler to operate when a specific attribute is set, I wouldn't worry about it. Aside from those specific situations, attributes aren't even accessed until a user triggers code to reference them.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-12-16 at 01:57 PM.
  Reply With Quote
11-12-16, 02:48 PM   #3
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Sorry, I don't mean attributes as in SetAttribute; just general object properties such as SetSize, SetColor, SetAlpha, etc.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
11-12-16, 06:39 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
I don't think it matters either way. When it comes to groups of settings, a frame won't show until it has a size and position; can't respond to events until it has an event registered and a handler; can't respond to clicks until it's enabled and has an associated handler; etc. In the long run, frames don't care what order you apply their settings in as long as everything is accounted for when you're done setting them up.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-12-16 at 06:44 PM.
  Reply With Quote
11-13-16, 09:22 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The specific example you mentioned -- SetParent before SetPoint -- is the only one I can think of where the order might matter, but you can easily make the order of those two not matter by specifying all of the point data explicitly. Instead of something like "TOP, 0, -100", do "TOP, UIParent, TOP, 0, -100".

If you have a GUI for users to change these properties, and you want to make sure the frame is always positioned relative to its parent, the code that handles user input should automatically update the point data when the parent is changed.
__________________
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

WoWInterface » Developer Discussions » General Authoring Discussion » Order dependent frame methods?

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