Last updated at 8:07 am UTC on 18 August 2019
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).
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)
StringMorph and SimpleButtonMorph example -- another counter
You can add custom menu entries to any Morph, see Morph menus.