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

Home » Public Forums » archive » dynamically change the layout of widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: dynamically change the layout of widget [message #38655 is a reply to message #38527] Thu, 18 March 2004 05:24 Go to previous messageGo to previous message
robert.dimeo is currently offline  robert.dimeo
Messages: 42
Registered: November 2001
Member
Try this...


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro ev_handler,event
uname = widget_info(event.id,/uname)
case uname of
'button_1': $
begin
but_b = widget_button(event.top, $
value = 'Now Press Me', $
uname = 'button_2')
end
'button_2': $
begin
widget_control,event.id,/destroy
end
'quit': widget_control,event.top,/destroy
else:
endcase
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro dynamic_widget
tlb = widget_base(/col,/tlb_frame_attr)
but_a = widget_button(tlb,value = 'Press Me', $
uname = 'button_1')
quit_button = widget_button(tlb,value = 'Quit', $
uname = 'quit')
widget_control,tlb,/realize
xmanager,'dynamic_widget',tlb,/no_block, $
event_handler = 'ev_handler'
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Hope this helps,

Rob

Tianle Yuan <tianle@rac3.wam.umd.edu> wrote in message news:<c39u52$spn$1@grapevine.wam.umd.edu>...
> Hi,there
>
> Here's my question: I have set up a widget base and layout. There's a
>
> button,But_A, in that widget base. For it,I creat a event handler, pro_A.
>
> What I'm wishing to do is when I click the button and the event handler is
>
> called, I will create another widget in the widget base I set up before.
>
> How can I realize it ,or is it possible?
>
> Thanks a lot.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Problem with pointers to structures
Next Topic: Widget scrolling

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

Current Time: Thu Oct 09 21:55:12 PDT 2025

Total time taken to generate the page: 0.88111 seconds