Re: Multiple widgetized windows in one application [message #15130] |
Sun, 25 April 1999 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Kenneth P. Bowman (bowman@null.edu) writes:
> I'm trying to write a widget program that has multiple widgetized
> windows.
>
> The program works, mostly. All three windows are realized. Events in
> base_id and display_1_id windows are passed to MANIFOLD_EVENT. For some
> reason, however, no events in 'Display 2' are passed to MANIFOLD_EVENT. I
> know this because I print out part of every event that comes to
> MANIFOLD_EVENT.
>
> Am I doing something wrong here?
I don't see anything manifestly wrong. I wrote a simple test
program putting your principles to work. The program, named TEST,
works perfectly. I include it below.
You don't mention what version of IDL you are running,
but mine runs fine in IDL 5.2 on Windows NT.
Cheers,
David
--
PRO TEST_EVENT, event
Widget_Control, event.id, Get_UValue=thisValue
IF event.type NE 0 THEN RETURN
Print, ''
Print, thisValue
END
PRO TEST
tlb = Widget_Base(XOffset=50, Title='Manifolds')
draw = Widget_Draw(tlb, XSize=200, YSize=200, $
UValue='Manifold', Button_events=1)
tlb1 = Widget_Base(XOffset=150, Group_Leader=tlb, Title='Display 1')
draw1 = Widget_Draw(tlb1, XSize=200, YSize=200, $
UValue='Display 1', Button_events=1)
tlb2 = Widget_Base(XOffset=250, Group_Leader=tlb, Title='Display 2')
draw2 = Widget_Draw(tlb2, XSize=200, YSize=200, $
UValue='Display 2', Button_events=1)
Widget_Control, tlb, /Realize
Widget_Control, tlb1, /Realize
Widget_Control, tlb2, /Realize
XManager, 'test', tlb1, /Just_Reg
XManager, 'test', tlb2, /Just_Reg
XManager, 'test', tlb
END
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Multiple widgetized windows in one application [message #15148 is a reply to message #15130] |
Fri, 23 April 1999 00:00  |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
Ken,
I can not see any difference in how you defined 'display_1' and 'display_2'
in your sample code - they are totally identical. If you are saying that one
does pass events and another does not, there must be a difference in your
real code - possibly a typo which causes xmanager to direct events from
'display_2' to a wrong destination.
I have no idea what did you use /JUST_REGISTER for. I never used it and all
my applications (quite complex multi-panel, multi-layered, multi-window, with
obj graphics and read/write, etc.) work ok. Try getting rid of this keywords.
Try at the very end of laying out the widget trees doing:
widget_control, display_2_id, event_pro = 'manifold_event'
If it helps, then you have a typo in the code above it.
Cheers,
Pavel
|
|
|