Hello all,
is there a standard way to attach a context menu to a morph?
It's fairly easy to do by checking for yellowButtonPressed and manually firing up a MenuMorph.
But it is sufficient to implement #addCustomMenuItems:hand: to get an enhanced Halo menu while #addYellowButtonMenuItemsTo:event: and #hasYellowButtonMenu don't help.
So is there a predefined way without everybody doing his own?
Thanks,
Herbert mailto:herbertkoenig@gmx.net
To add a context menu to a morph class: 1. Enable mouse handling: #handlesMouseDown: anEvent ^ true. 2. Decide if you want to start with the standard menu, or go totally custom a. If you want to include the standard options: 1. defaultYellowButtonMenuEnabled ^ true. 2. #addCustomMenuItems:hand: with your morph-specific items b. To take full control and start from scratch, specify menu items in #addYellowButtonMenuItemsTo:event:
Probably too late to help the OP ;-) But I wanted to document this, especially for myself when I forget in two weeks!
Sean
-- View this message in context: http://forum.world.st/Is-there-a-tandard-way-to-attach-context-menus-tp10845... Sent from the Squeak - Beginners mailing list archive at Nabble.com.
beginners@lists.squeakfoundation.org