multiple text
Boris Gaertner
Boris.Gaertner at gmx.net
Fri Jan 2 11:35:21 UTC 2004
ye juan <yejuan_1204 at yahoo.com.cn> asked:
> Happy new year!
> I start to develop applications in Squeak, but I am
> not familar with its GUI. When I put more than one
> pluggableTextMorph in a window, how can I confirm
> these different ones. For example, there are a list
> and three texts: one for displaying the name of a
> selected one in the list, one for displaying the id
> when the button "ID" is pressed, and another for
> inputting.
> (1)How I define the second text:(When the button "ID"
> is not pressed, the second text is hoped to display
> nothing.)
> idText:= PluggableTextMorph on:self
> text:???
> accept:nil
> readSelection:nil
> menu:nil.
Every text morph should have its own selector to
access its display text. So you may have
#text1, #text2, #text3 for three text fields.
> (2) How I record the value users input in the third
> text:
> inputText:= PluggableTextMorph on:self
> text:???
> accept:???
> readSelection:nil
> menu:nil.
The argument of 'accept' is a selector that
takes two arguments: e.g. #accept:from:
The first argument is the string that is displayed
by the morph, the second argument is the morph itself.
The method is *required* to answer a boolean value:
true to accept the text or false to refuse acceptance.
> Additionally, if you have any projects or codes
> related to such situations, please send to me. Thanks!
Attached you find a small demo that may help you
getting started. Please have a look at the comments
in the methods.
Regards, Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MorphicGUIDemo.1.cs.gz
Type: application/x-gzip
Size: 2076 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040102/3230d71c/MorphicGUIDemo.1.cs.bin
More information about the Squeak-dev
mailing list
|