Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
StringMorph
Last updated at 6:18 am UTC on 21 June 2018
Use the text below as a start for the StringMorph class comment


StringMorph is a subclass of Morph. It has the instance variables:

It further has 20 subclasses (Squeak 3.3a and still in Squeak 6.0a).


How to construct a StringMorphs with a particular font

See StringMorph examples - Bitmap DejaVu Sans 9, 18, 36


Edit content of StringMorph

If you shift-click on a StringMorph you can edit it's string.

This is accomplished the following way:

class StringMorph overrides the message #mouseDown: and then tests

(evt shiftPressed and: [self wantsKeyboardFocusOnShiftClick]) and if it is true it launches a StringMorphEditor.

StringMorph as a button

A StringMorph may as well be used like a SimpleButtonMorph to do an action when clicked.
Use the menu 'extras' / 'add mouseUpAction'.

The following propery will be defined:
 aStringMorph valueOfProperty: #mouseUpCodeToRun

see Morph mouse up action (Smalltalk expression)

You can add custom menu entries to any Morph, see Morph menus.