Thanks so much! Adding a new state allowed me to do exactly what I wanted.
Just out of curiosity, how come I was seeing all the child controls styled using the "icon-white-warning" appearance even though I was not using the child control appearance id, and some were explicitly assigned "icon-white"? Does the setAppearance function apply at the class level and not the instance level? Any ideas? Thanks again for the prompt, extremely useful help! Andrew On Jul 1, 2011, at 6:46 AM, Alexander Steitz <[email protected]> wrote: > Hi Andrew, > > On Friday 01 July 2011 00:30:18 Andrew Goldberg wrote: >> I am observing an unexpected behavior regarding applying different >> appearances to different instances of a custom widget. >> >> My code structure is basically: >> >> Card widget >> - icon child control >> >> Depending on certain properties of the Card, I would like to apply a >> different appearance to the icon child control. In the >> _createChildControlImpl function, I create the child control named >> "control" and then do control.setAppearance("..."), where the name of the >> appearance I pass depends on some property of the Card widget. Regardless >> of what appearance I assign this way, it seems that all Cards' icon child >> controls end up with the same appearance. Is this a feature or a bug? > It's a feature. Every child control automatically gets an appearance ID > assigned. So e.g. your core widget has the appearance "foo" and you create a > child control "bar". This would end up in the appearance ID "foo/bar" for the > child control. > See > > http://manual.qooxdoo.org/1.4.x/pages/gui_toolkit/ui_develop.html#styling > > for more details. > >> The names of the appearances provided are "icon-white" and >> "icon-white-warning" --- do I need to use appearance selectors that >> include an appearance selector for the Card widget, like "card/icon-white" >> and "card/icon-white-warning"? I just assumed that if I am explicitly >> setting the appearance, then I could use arbitrary names. > If you use child controls the appearance IDs are set automatically. A > solution > to your problem (assigning a different appearance for several instances) > might > be "states. > > http://manual.qooxdoo.org/1.4.x/pages/gui_toolkit/ui_appearance.html?#states > > You can use the "addState" / "removeState" methods to customize the look of a > widget. Framework widgets like the button use states to react on hover, > pressed or disabled states. > If you add a state you can react on this state within your appearance theme. > > Regards, > Alex > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
