Newbie Question on Text Input
Donald Major
Donald.Major at sas.com
Tue Nov 29 16:09:02 UTC 2005
You might want to look at PluggableTextMorph, and its use in the PDA
class. I'm not sure this is the right way to do it, but it IS a way to
do what I think you're asking for.
Roger McDermott wrote:
> Hi
>
>
>
> I’ve just joined this list and I have a question regarding getting input
> into Squeak. I would say at the outset that I am a novice programmer
> (although I have used some Smalltalk before and know a little Java) so I
> apologise if this is a bit basic.
>
>
>
> I appreciate that one can use the Transcript window to give simple
> screen output from code run in the Workspace but is there a similar
> (ready-made) window that can be used to get input?
>
>
>
> In one of the Java packages that I use there is a class called a
> ConsoleWindow which allows input and output in the same window, e.g.
>
>
>
> ConsoleWindow c = new ConsoleWindow();
>
> c.out.println("Please input an integer");
>
> myInteger = c.input.readInt();
>
> c.out.println("Your integer times two is" + 2 * myInteger);
>
>
>
> In private emails, Ken Rose pointed towards the Workspace window (but
> unfortunately I am not adept enough to get that to work in the way I
> want) and Stephane Ducasse gave me the following code snippet
>
>
>
> | res |
>
> res := FillInTheBlank request: 'please enter a number'.
>
> res asNumber.
>
>
>
> which does allow things to be input but the FillInTheBlank object
> disappears as soon as you enter a number. I’m sure that there is a very
> simple way of doing this but, at present, it is still unclear to me.
>
>
>
> Any help would be much appreciated.
>
>
>
> Roger McDermott
>
>
>
>
> ------------------------------------------------------------------------
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Donald.Major.vcf
Type: text/x-vcard
Size: 283 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20051129/3fa63a0e/Donald.Major.vcf
More information about the Squeak-dev
mailing list
|