links to this page:    
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
SimpleButtonMorph - 'quit' example
Last updated at 8:03 pm UTC on 22 February 2017
The following example shows how to use a SimpleButtonMorph to create a button which quits the image without saving it. This may be useful in a kiosk application where you want to provide an easy way to quit the application while not actually changing the image.

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

Then place the button where you want it to be on the desktop.

The same code written with cascading:
    (SimpleButtonMorph new
        target: Smalltalk;
        label: 'quit';
        actionSelector: #snapshot:andQuit:;
        arguments: (Array with: false with: true))