Squeak Class Documentation category index | class index  
 
ScriptableButton
  category: Morphic-Scripting
  superclass: UpdatingSimpleButtonMorph
  subclasses:

A button intended for use with the card architecture and the user-scripting system.

instance methods
  accessing
  scriptSelector
scriptSelector:

  action
  doButtonAction

  label
  label
label:
label:font:
setLabel

  miscellaneous
  demandsThumbnailing
initializeToStandAlone

  script
  editButtonsScript
wantsScriptorHaloHandle

class methods
  authoring prototype
  authoringPrototype

  name
  defaultNameStemForInstances
descriptionForPartsBin

  viewer
  additionsToViewerCategories

instance methods
  accessing top  
 

scriptSelector


 

scriptSelector:


  action top  
 

doButtonAction

The user has pressed the button. Dispatch to the actual user script, if any.


  label top  
 

label

Answer a string representing the label of the receiver, returning an empty string if necessary


 

label:

Set the receiver's label as indicated


 

label:font:

Set the receiver's label and font as indicated


 

setLabel

Invoked from a menu, let the user change the label of the button


  miscellaneous top  
 

demandsThumbnailing

Answer whether the receiver, if in a thumbnailable parts bin, wants to be thumbnailed whether or not size requires it. This is set to true here because the recent event rework somehow made it possible for a scriptable button to be draggable from a parts bin otherwise, maddeningly


 

initializeToStandAlone

Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.


  script top  
 

editButtonsScript

The user has touched my Scriptor halo-handle. Bring up a Scriptor on the script of the button.


 

wantsScriptorHaloHandle

Answer whether the receiver would like to have a Scriptor halo handle put up on its behalf. Initially, only the ScriptableButton says yes


class methods
  authoring prototype top  
 

authoringPrototype

Answer a scriptable button that can serve as a prototype for a parts bin


  name top  
 

defaultNameStemForInstances

Answer the default name stem to use for instances of the receiver


 

descriptionForPartsBin

If the receiver is a member of a class that would like to be represented in a parts bin, answer the name by which it should be known, and a documentation string to be provided, for example, as balloon help. When the 'nativitySelector' is sent to the 'globalReceiver', it is expected that some kind of Morph will result. The parameters used in the implementation below are for documentation purposes only!


  viewer top  
 

additionsToViewerCategories

Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories.