It does not appear to be possible to set the selected value of a fwt::Command in the constructor. i.e. The following always prints Toggle Selected = false
I guess a static constructor method would work - but this threw me for a while...
dobesvMon 5 Mar 2012
Looks like it's got some kind of protection in the setter for selected so it only works if it's in CommandMode.toggle:
**
** If this command is using toggle mode, then set the
** selected state and update all the registered widgets.
**
Bool selected := false
{
set
{
newVal := it
if (mode != CommandMode.toggle) return
this.&selected = newVal
widgets.each |Widget w|
{
try { w->selected = newVal } catch {}
}
}
}
Perhaps setting mode before setting selected would work?
SlimerDudeMon 5 Mar 2012
Yes and Argh!
Thanks, yeah, I did look at the setter... but then messed up my logic and decided I had to set the toggle mode after selected. That'll learn me to stay up late coding!
SlimerDude Sun 4 Mar 2012
It does not appear to be possible to set the
selected
value of a fwt::Command in the constructor. i.e. The following always printsToggle Selected = false
I guess a static constructor method would work - but this threw me for a while...
dobesv Mon 5 Mar 2012
Looks like it's got some kind of protection in the setter for selected so it only works if it's in CommandMode.toggle:
Perhaps setting mode before setting selected would work?
SlimerDude Mon 5 Mar 2012
Yes and Argh!
Thanks, yeah, I did look at the setter... but then messed up my logic and decided I had to set the toggle
mode
afterselected
. That'll learn me to stay up late coding!