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

Home » Public Forums » archive » widget_table bug?
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_table bug? [message #20240] Tue, 30 May 2000 00:00
Ray Muzic is currently offline  Ray Muzic
Messages: 5
Registered: June 1997
Junior Member
I'm having problems with widget_table. On a single character insertion
(event.type = 0), I believe the event.offset is not always correct. Run
the test procedure in the example code (below). It creates a
widget_table in a widget_base. Whenever a widget_table event is
generated, the program dumps (help,/struct) the event.

When you run it you'll notice the string 123 has been placed in the
upper left cell. Double-click on this cell to put it into edit mode
and move the insertion point to just after the 3. Press the 4 key.
Observe that the event.offset value is 2 for the character insertion
event (type=0). Shouldn't it be 3? Now, delete the 4 and move the
insertion point to between the 2 and 3. Press the 4 key. Note the
event.offset is 2. How the heck am I supposed to tell the difference
between the user inserting a character at these two locations????

Particulars

IDL> print,!version
{ x86 Win32 Windows 5.2 Oct 30 1998

Am I missing something or is this a bug?

Ray
rfm2@po.cwru.edu



test,pro -----------------------------------
pro dataEntry, event

print,'Event type: ',event.type

help,/struct,event


return
end


pro test

nr = 3
rl = strarr(nr)
for i=1,nr do begin
rl(i-1) = string(i, format='(i4)')
endfor
cl = ['C1', 'C2', 'C3', 'C4', 'C5']
nc = n_elements(cl)

v=strarr(nc,nr)
v(0,0)='123'
device, GET_SCREEN_SIZE=scrsiz
b = widget_base(/column)
t = widget_table(b, $
value = v, $
xsize = n_elements(cl), ysize = nr, $
x_scroll_size = 5, $
y_scroll_size = 10, $
column_labels = cl, $
column_widths = [ 75, 100, 100, 100, 100], $
row_labels = rl, $
/editable, /all_events, event_pro='dataEntry')


widget_control, b, /realize
xmanager,'test', b


return
end


Sent via Deja.com http://www.deja.com/
Before you buy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: widget_table bug?
Next Topic: test2 - please ignore

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

Current Time: Wed Oct 08 20:05:53 PDT 2025

Total time taken to generate the page: 0.00649 seconds