=== Top of the Swiki === Attachments ===

Recipe: How to use an IconicButton in Morphic

Problem


You would like to have an icon in your Morphic world which activates
the evaluation of a block of code when clicked.

Solution


You might want to use an IconicButton. If the action you want to perform is relatively simple, even you don't have to override anything.

target _ [self doSomething].
i _ IconicButton new.
i labelGraphic: aForm.
i target: target.
i actionSelector: #value.
i openInWorld.

The "target" in the above will be evaluated when you click
on the button. You can pass any number of arguments to the
target as well.

Source

Mailing list - ohshima@is.titech.ac.jp / Fri, 26 Nov 1999