CW_FIELD question [message #54234] |
Fri, 25 May 2007 11:01  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
I know there must be something basically wrong with my thinking on
this, but I can't figure out why this doesn't work. I'm writing a
program that makes use of DRAW and TEXT widgets without an event
handling routine. I would like some widgets to be used as numeric
entry fields in which the user can enter numeric data to be read by
the program. These should not be modal widgets.
Here is an example of what I'm trying to do:
PRO Example
tlb = Widget_Base(Column=1)
field1 = WIDGET_TEXT(tlb, /EDITABLE)
field2 = CW_FIELD(tlb, /FLOATING)
WIDGET_CONTROL, tlb, /REALIZE
XManager, 'example', tlb, /No_block
quita = 0
curval=''
WIDGET_CONTROL, field1, GET_VALUE=curval
while quita ne 1 do begin
WIDGET_CONTROL, field1, GET_VALUE=f1val
WIDGET_CONTROL, field2, GET_VALUE=f2val
if f1val ne curval then begin
curval = f1val
print, curval
print, f2val
if curval eq 'q' then quita = 1
endif
wait, 0.1
endwhile
WIDGET_CONTROL, tlb, /DESTROY
END
When you run this program, the WIDGET_TEXT field is editable and
behaves as expected, but the CW_FIELD field is not editable. What is
going on? There must be something basic that I'm missing here.
Thanks,
Mark
|
|
|