Skip to content
Stephen De Gabrielle edited this page Mar 6, 2014 · 9 revisions

There are at least three ways to make a button. (are there more)

  1. getting a button from the factory and giving it a method to call (details below)
  2. use Create button in the middle-button/opt-button (yellow) menu.
  3. use the core sampler to 'Yank it out' the Send button from the the middle-click/opt-click menu

1. using the factory to add a button to the gasTank Morph

  1. open the gasTank Morph
  2. Drag a button from the factory window on top of the has tank morph.
  3. Middle-click/opt-click the button and click 'set target'. This sets the target to the gas tank.
  4. Drag the button off the tank.
  5. Open an outliner for the button (right-click/cmd-click, click Outliner of Morph...).
  6. Click the E to get an evaluator.
  7. type script: 'target addAnAtom'
  8. Click Do it

2. use Create button in the middle-button/opt-button (yellow) menu.

A special menu item to create buttons. Who knew. I've made a quick youtube video: Adding a button

3. use the core sampler to 'Yank it out' the Send button from the the middle-click/opt-click menu

This way lets you use the Send button that is created when you middle-click/opt-click the method in the outliner.

  1. middle-click/opt-click the method addAnAtom in the gasTank outliner
  2. left-click(click!) the beveled bar at the top of the menu to 'pin' it.
  3. right-click/cmd-click the menu, then click Core Sampler...
  4. grab the core sampler and move the cross-hairs over the Send button
  5. middle-click/opt-click ui2Button then click Yank it out to grab the Send button
  6. place the Send button on the self workspace
  7. click the Send button to add an atom to the gasTank Morph.

I've not yet fully worked out how to change label on a button. Add a wiki page if you can work it out.

Thanks to ardeujho for explaining how to make a factory button call a method. Thanks to Jecel Assumpcao Jr. for pointing me to the video for the core sampler technique. Thanks to Randall B. Smith and the other designers and builders of Self for making the video.


On Wed, Mar 5, 2014 at 9:50 PM, ardeujho wrote:

The basic steps for making a button are:

  1. Drag a button from the factory window on top of the has tank morph.
  1. Middle click the button and click 'set target'. This sets the target to the gas tank.
  1. Drag the button off the tank.
  1. Open an outliner for the button (right click, open outliner). Click the 'E' to get an evaluator. Run: 'script: 'target addAnAtom'

Now when you press the button it will call 'addAnAtom' on the target, that being the gas tank.

Clone this wiki locally