On Mon, Apr 1, 2013 at 12:20 PM, Haroldo Stenger <[email protected]>wrote:
> Not long ago, Edward you told me about : > > @button set-style c.frame.top.leo_ui.setStyleSheet(p.b) > > More deeply, I'm trying hard to understand why > c.frame.top.leo_ui.setStyleSheet(p.b) works, and I can't realize myself. Ah. I see that the script:: c.frame.top.leo_ui.setStyleSheet(p.b) contradicts the advice about using official ivars. I'm not sure there is an official ivar for leo_ui. All I can tell you without looking at the code is that c.frame.top.leo_ui must be a real Qt widget, but off hand I couldn't tell you what it is. > what does p.b contain that is relevant to set StyleSheet(), the template that I want to use as the new one? This one I can answer. In any script, p is the presently selected node. This is true **even when executing script buttons**. That's the genius of script buttons. So p.b is, as usual, the body text of the selected node, which must be (because leo_ui is a Qt widget) a valid Qt style sheet. HTH. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
