[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
PragmaMenuBuilder!
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

MyMorph>>menuBuilder
	^ (PragmaMenuBuilder pragmaKeyword: 'tileMenu' model: self)

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

Thanks!

Fernando




More information about the Pharo-project mailing list