Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
SimpleButtonMorph class comment
Last updated at 12:53 am UTC on 17 January 2006
Edit SimpleButtonMorph class comment here. Some of this taken from below.

See: SimpleButtonMorph

This comment has now been harvested; feel free to make any additions, but please mark them as such so we can tell the differences. If additions warrant, the comment can go out again.



I am labeled, rectangular morph which allows the user to click me. I can be configured to send my "target" the message "actionSelector" with "arguments" when I am clicked. I may have a label, implemented as a StringMorph.


SimpleButtonMorph new
target: Smalltalk;
label: 'Beep!';
actionSelector: #beep;
openInWorld

Structure:

Another example: a button which quits the image without saving it.


SimpleButtonMorph new
target: Smalltalk;
label: 'quit';
actionSelector: #snapshot:andQuit:;
arguments: (Array with: false with: true);
openInWorld