Widget events and resizing [message #43961] |
Mon, 09 May 2005 12:13 |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
Has anyone else experienced the following version 6.1 widget glitch (IDL
v6.1.1, FC3 Linux here)? Resizing WIDGET_BASE causes menus to appear in
the wrong place and other interface elements to be non-responsive, until
the base is repositioned.
Here is a simple routine which demonstrate this:
pro tlb_menu_test_event,ev
case tag_names(ev,/STRUCTURE_NAME) of
'WIDGET_BASE': print,'Got resize'
'WIDGET_BUTTON': begin
widget_control, ev.id,GET_UVALUE=p
print,p
end
endcase
end
pro tlb_menu_test
b=widget_base(/TLB_SIZE_EVENTS,MBAR=bar,/COLUMN)
file=widget_button(bar,VALUE='File',/MENU)
b2=widget_button(file,VALUE='Hello',UVALUE='hello')
but=widget_button(b,VALUE='Test',UVALUE='test')
widget_control, b,/realize
XManager,'tlb_menu_test',b
end
compile that and then run:
IDL> tlb_menu_test
Now try out the button and menu item. Should print 'hello' and
'test'. Now move and then resize the whole base. Try the menu and
button again. I find the menu shows up where it was originally
realized (e.g. top left of the screen), instead of under its menu
heading, and the button no longer works. Now move the base again but
keep it the same size; everything should work fine again, until you
resize once more.
The culprit seems to be TLB_SIZE_EVENTS. Removing that solves the
problems (but then you get no resize events). This is a new problem
in v6.1; it wasn't there in v6.0. Incidentally, I also notice only
one resize event is now delivered with v6.1, i.e. "box" vs. "opaque"
resizing (much preferable IMO).
JD
|
|
|