set menu item's state
set menu item's state
- Subject: set menu item's state
- From: phil03 <email@hidden>
- Date: Tue, 18 Mar 2014 23:23:47 +0700
(Building on Xcode 5.1, OSX 10.9.2; deployment target = 10.9)
Here's some pseudo-code for an action method that's called by a menu bar
menu item with the intent of simply toggling a property:
on menuItemCall_(sender)
if sender's state() = 1 --'on'
set sender's state to 0 --'off'
set my someProperty to "no value"
else
set sender's state to 1 -- 'on'
set my someProperty to "yes value"
end if
end menuItemCall
This code does what I want it to - toggle a property on and off.
However, the problem is the menu in the GUI remains in the same visual
state as it was before the call (i.e., if it was 'ticked' it's still
ticked even after its state is set to 0. I logged it and checked that it
was in fact 0 too, but the ticked state is still seen by the user in the
menu list. Likewise if it wasn't ticked and then toggled, it changed
values in my properties accordingly but visually remained the same).
How do I get the GUI to update the state of the menu list item? (BTW, I
tried doing this by binding it to a Value & Model Key Path and checking
'Validates Immediately' but that didn't work either).
TIA for any help
Best
P
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden