Last updated at 2:46 pm UTC on 12 May 2018
Use the text below as a start for the StringMorph class comment
StringMorph is a subclass of Morph. It has the instance variables:
- font (normally nil; then the accessor #font gives back TextStyle defaultFont)
It further has 20 subclasses (Squeak 3.3a and still in Squeak 6.0a).
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.