On Sun, Oct 23, 2011 at 9:21 PM, Terry Brown > Interesting. Every widget can have its own stylesheet, but you're > talking about sheets on the same widget?
Correct. > What about adding new widgets I don't care about that case. > Or is the effect you're seeing just that already styled widgets aren't > restyled when you switch to a stylesheet that doesn't address > them specifically? What I am saying is that adding a stylesheet for a particular widget (object) only changes the particular *attributes* for *that* widget that are specified by the particular stylesheet. That's why Leo's present code works. w.setStyleSheet doesn't re-init the attributes (styles) for w. So setting a border, say on the body pane, doesn't clear colors on the body pane, and setting colors on the body pane doesn't clear borders on the body pane. Even though, if you *ask*, "what is the stylesheet on a widget?", you will only get the *last* stylesheet set by w.setStyleSheet. Again, my model for what is happening is that calls to w.setStyleSheet actually just set attributes in the object, and without clearing non-related attributes. The stylesheet is just a way of specifying sets of attributes. Whether you call this elegant or not depends on your point of view. For Leo, it is just a bit clunky, but it's not seriously clunky provided we realize that we don't have to remember previous stylesheet settings! Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
