[Pharo-project] Menu creation and invocation

Fernando Olivero fernando.olivero at usi.ch
Thu Feb 17 21:15:58 CET 2011

I want to give the thanks to Alain, for the excellent work on
Making menus is elegant and straightforward this way!

I post here how i'm using them:

MyMorph>>mouseDown: aMouseEvent
	aMouseEvent redButtonPressed ifTrue:[ self click: aMouseEvent ].
	aMouseEvent yellowButtonPressed ifTrue:[ self leftClick: aMouseEvent ].
MyMorph>>leftClick: aMouseEvent	
	self menuBuilder menu popUpInWorld

	^ (PragmaMenuBuilder pragmaKeyword: 'tileMenu' model: self)

And you can nicely decouple the menu invocation from the menu creation!



More information about the Pharo-project mailing list