Code: Select all
TEXT="go"
Code: Select all
<togglebutton>
<label>'"$TEXT"'</label>
<variable>BTN</variable>
<action>if true let TEXT="stop"</action>
<action>if false let TEXT="go"</action>
<action>refresh:BTN</action>
</togglebutton>
Code: Select all
TEXT="go"
Code: Select all
<togglebutton>
<label>'"$TEXT"'</label>
<variable>BTN</variable>
<action>if true let TEXT="stop"</action>
<action>if false let TEXT="go"</action>
<action>refresh:BTN</action>
</togglebutton>
Code: Select all
<togglebutton>
<input file stock="gtk-'"$TEXT"'"></input>
<variable>BTN</variable>
<action>if true let TEXT="yes"</action>
<action>if false let TEXT="no"</action>
<action>refresh:BTN</action>
</togglebutton>
Hmmm...I'm afraid I failed to discribe my problem properly - though I tried to put it into the thread title. This thread was intended to clarify variable values and their scope, not togglebuttons and their limitations. I used togglebuttons only as an example. If this was a bad example, I'm sorry.zigbert wrote:The mistake is the call for gtk stock icons.
Code: Select all
<action>if true let TEXT="yes";xmessage $TEXT</action>
Code: Select all
<action>TEXT="yes"</action>
<action>xmessage $TEXT</action>
Code: Select all
<action>TEXT="yes";xmessage $TEXT</action>
I didn't find this example in your manual.don570 wrote:In my manual this is example that is closest
Thanks, I've seen this example and it's a bit funny. The irony here: The togglebutton is the only button that does NOT toggle. The image doesn't change, the label doesn't change, but this would be essential for a togglebutton since the user needs a clue what the button will trigger.don570 wrote:To avoid using an SVG image button I tried a togglebutton instead.
I have found a reliable way to think about this sort of thing. In all cases where gtkdialog doesn't know the item used directly, I think of <action> as meaning "fire up a subshell and pass this string as a command to it". The subshell closes at the end of the command.MochiMoppel wrote:However this works:Code: Select all
<action>TEXT="yes"</action> <action>xmessage $TEXT</action>
Code: Select all
<action>TEXT="yes";xmessage $TEXT</action>