Hi mhab,
As Hooray has said, you could do it via Canvas GUI. However, that would be time-consuming. Canvas GUI is alright, but it needs a few more widgets before it can fully replace the current PLIB PUI.
Assuming that you want to change the button's label when it is clicked, this XML code should help:
- Code: Select all
<?xml version="1.0"?>
<PropertyList>
<!-- ... -->
<nasal>
<open>
var dlg_root = cmdarg();
var n = props.Node.new({ "dialog-name": "test" });
var toggle_label = func {
if(dlg_root.getNode("button[1]/legend").getValue() == "Number 1"){
dlg_root.getNode("button[1]/legend").setValue("Number 2");
}else{
dlg_root.getNode("button[1]/legend").setValue("Number 1");
}
fgcommand("dialog-close", n);
fgcommand("dialog-show", n);
}
</open>
</nasal>
<!-- ... -->
<button>
<legend>Number 1</legend>
<binding>
<command>nasal</command>
<script>update_label();</script>
</binding>
</button>
<!-- ... -->
</PropertyList>
All you need to do is change:
- "dialog-name": "test" to match the name of your dialog.
- the if condition.
- the index of the button (in this case 1) to the correct (zero-based) index.
- the labels used (obviously).
I hope that helps,

Red Leader