comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » widget text
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
widget text [message #37766] Tue, 20 January 2004 08:12 Go to next message
Nuno Oliveira is currently offline  Nuno Oliveira
Messages: 75
Registered: October 2003
Member
Hi.

I'm working with text widget with keyword editable and I would like that the
user would not be able to insert more than three characters. Keyword xsize
only controls the size, not the length of the contents.



The only that occurs to me is seeking for all widget text events, and if the
string has per example four characters then it extracts a sub string with
the first three characters.



The question if there's a parameter or any other way to do this easier.



Cheers,



Nuno.
Re: Widget text [message #43179 is a reply to message #37766] Fri, 18 March 2005 07:25 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
It's not clear to me what you are asking for here. Perhaps you are
interested in a pop-up dialog widget, in which you collect information
from the user and return it to your program. If so, you might want to
have a look at this article:

http://www.dfanning.com/widget_tips/popup.html

Cheers,

David
Re: Widget text [message #43181 is a reply to message #37766] Fri, 18 March 2005 00:02 Go to previous message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
CSUIDL PROGRAMMEr wrote:
> HI i am learning Widget IDL programming
> I want to know, how to process text fro Widget _ text such that when
> user enters text and presses submit button action is taken. How to pass
> text to button event handler
>
The best thing you can do is saw a simple example IDL code or a library
utility.

When your widget is relatively simple, normaly assigns an structure with
all needed information to the UVALUE of the main widget_base.

info = { text: your_widget_text, button: your_widget_button}
WIDGET_CONTROL, base, SET_UVALUE=info

Also you need to "call" your widget_text and widget_button assing an
string into their UVALU:
WIDGET_CONMTRL, you_text, SE_UVALUE='TEXT'
WIDGET_CONTROL, your_button, SET_UVALUY='BUTTON'

Also, you register an event_handler to handle all the events on the main
widget_base. Get the event.id, get its UVALUE (and get the UVALUE from
event.top, that is the main widget):

PRO event_handler, event

WIDGET_CONTROL, event.id, GET_UVALUE=uval
WIDGET_CONTROL, event.top, GET_UVALUE=info

CASE uval OF
'TEXT': print, 'event on widget_text'
'BUTTON': BEGIN
print, ' event on button'

WIDGET_CONTROL, info.text, GET_VALUE=string

print, 'your text is' + string
END
END

More or less these are the steps.


Another method is to asign to button's UVALUE the widget_text. Creates
the button with EVENT_PROC:

button = WIDGET_BUTTON(VALUE='ok', UVALUE=your_widget_text,
EVENT_PROC=my_proc)

PRO my_proc, event

WIDGET_CONTROL, event.id, GET_UVALUE=text

WIDGET_CONTROL, text, GET_VALUE=string

print, string

END


Bye,
Antonio.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Running IDL RPC on Linux
Next Topic: IDL 6.1 ENVI 4.1 Interation Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:25:17 PDT 2025

Total time taken to generate the page: 1.92105 seconds