menu items with check mark

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

menu items with check mark

rush
Hello,

I would like to implement a little check mark beside the menu item depending
on the state of the app. Do I need to say something special in VC, and how
can I programatically chaneg the state of the check mark?

Thanks,

rush
--
http://www.templatetamer.org/


Reply | Threaded
Open this post in threaded view
|

Re: menu items with check mark

Bruno Brasesco
You can do it inside the #queryCommand:

queryCommand: query
| event |
event := query commandSymbol.

(event = #workingOnIt)
ifTrue:[query isEnabled: (bugListP hasSelection and:[bugListP selection
notFixed]); isChecked: (bugListP hasSelection and:[bugListP selection
itsBeenStudied])].

The method is:

isChecked: aBoolean.


Reply | Threaded
Open this post in threaded view
|

Re: menu items with check mark

Andy Bower
In reply to this post by rush
Rush,

> I would like to implement a little check mark beside the menu item
depending
> on the state of the app. Do I need to say something special in VC, and how
> can I programatically chaneg the state of the check mark?

No, you don't need anything special in the VC (other than assigning your
menu item a command symbol as normal). Try browsing all references to
CommandQuery>>isChecked: and take a look at the uses within the
#queryCommand: methods. This should show you how it is done.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---