[Pharo-dev] [Pharo Trick: #0006] - Run code from a button window

Torsten Bergmann astares at gmx.de
Thu Dec 12 04:15:55 EST 2013


-----------------------------------------------------------------------------------
[Pharo Trick: #0006] - Run code from a standalone button window
-----------------------------------------------------------------------------------
Works in: Pharo 2.0, 3.0, ...
-----------------------------------------------------------------------------------

In Pharo there is a class called ButtonModel - it is a model used for buttons when
building UI's with the Spec framework. But it can be used also standalone
to open a button window with an action block:
  	
	|b|
	b := ButtonModel new.
	b openWithSpec;
	   label: 'Run my code';
	   action: [ Transcript open ]

So you just have to click to run some code.





More information about the Pharo-dev mailing list