Hi, 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. (2) How I record the value users input in the third text: inputText:= PluggableTextMorph on:self text:??? accept:??? readSelection:nil menu:nil. Additionally, if you have any projects or codes related to such situations, please send to me. Thanks! Regards, Lulu
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
ye juan yejuan_1204@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
squeak-dev@lists.squeakfoundation.org