1

I'm experimenting with the Self language and I just past the point of easy canned stuff. I want to prompt the user for a number, or perhaps provide a form for several numbers. Is there an equivalent to a scripting language's stdin-input, or a simple dialog, or do I have to grok Mophic and build it from scratch?

blueberryfields
  • 45,910
  • 28
  • 89
  • 168
Justin Love
  • 4,397
  • 25
  • 36

1 Answers1

2

Morphic is available in Squeak too.

Find any Morph in which Text can be entered (doesnt matter if single/multi-lined), middle-click it, clone it and create a reference to it. Then, for that object implement #keyUp:evt. The message that invokes this method is sent when the user releases a key on his keyboard when this Morph has the keyboard-focus. In the method you can get the text contained in the Morph and parse it.

Bernd Elkemann
  • 23,242
  • 4
  • 37
  • 66