strAnswer = ReadUserInput() [message #35520] |
Wed, 25 June 2003 02:12  |
Gert Van de Wouwer
Messages: 21 Registered: January 2002
|
Junior Member |
|
|
Hi,
I would like to have a function:
strAnswer = ReadUserInput()
readUserInput would then create a (modal) base, have a text-field where the
user types his tekst. When the base is
closed, the contents of the textfield are returnedn in strAnswer.
I've come up with this:
strTemp=''
ptr1 = ptr_new(strTemp)
ptr2 = ptr1
TextFieldBase, ptr1, group_leader=... ;this guy modifies *ptr1
...
at this point, ptr1 seems to be destroyed (by who, why?), but p2 points to
whatever is been filled in in textfieldbase.
It seems to work, but are there any pitfalls here? Is there any better way
to do this?
thanks for any input,
Gert
|
|
|
|
Re: strAnswer = ReadUserInput() [message #35666 is a reply to message #35520] |
Wed, 25 June 2003 07:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gert Van de Wouwer writes:
> I would like to have a function:
>
> strAnswer = ReadUserInput()
>
> readUserInput would then create a (modal) base, have a text-field where the
> user types his tekst. When the base is
> closed, the contents of the textfield are returnedn in strAnswer.
>
>
> I've come up with this:
>
> strTemp=''
> ptr1 = ptr_new(strTemp)
> ptr2 = ptr1
> TextFieldBase, ptr1, group_leader=... ;this guy modifies *ptr1
> ...
> at this point, ptr1 seems to be destroyed (by who, why?), but p2 points to
> whatever is been filled in in textfieldbase.
>
>
> It seems to work, but are there any pitfalls here? Is there any better way
> to do this?
> thanks for any input,
Try my TEXTBOX program:
http://www.dfanning.com/programs/textbox.pro
And here is an article that describes how to write
these pop-up dialog widgets correctly:
http://www.dfanning.com/widget_tips/popup.html
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|