X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 09 Jul 2015 05:12 AM by  anon
Widget_Draw Question
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
09 Jul 2015 05:12 AM
    Hi, I was wondering if it's possible to reset the content of a Widget Draw cause', for exemple, i've wrote an 'XYOUTS' on it and i want to delete it. Thanks.

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    09 Jul 2015 11:03 AM
    Hi Gerard, You should be able to use widget_control to get the value of the window, the you can use the erase method (http://www.exelisvis.com/docs/Erase_M...) to clear the widget window. Here is a small example widget I created which illustrates this: pro widget_window_clear_event, event compile_opt idl2 ;get th einformation stored in the base widget WIDGET_CONTROL, event.top, GET_UVALUE = info ;get the name of the button beign pressed WIDGET_CONTROL, event.id, GET_VALUE = name case name of 'Clear':(info.owin).erase 'Re-Draw':p = plot(/test, current = info.owin) 'Close':widget_control, event.top, /destroy else: endcase end pro widget_window_clear compile_opt idl2 ireset, /no_prompt ;widget window dimensions window_dims = [600,600] ;create starting widgets wBase = widget_base(/column) wDraw = widget_window(wBase,$ xsize=window_dims[0],$ ysize=window_dims[1]) widget_control, wBase, /realize wButtonNext = widget_button(wBase,value='Clear') wButtonNext2 = widget_button(wBase,value='Re-Draw') wButtonNext3 = widget_button(wBase, value='Close') ; Retrieve the newly-created Window object. widget_control, wDraw, get_value=oWin ;make sample plot p = plot(/test, current = oWin) ;clear the window of the second image that gets displayed info = {wBase: wBase,$ wDraw: wDraw,$ oWin: oWin} widget_control, wBase, set_uvalue=info xmanager, 'widget_window_clear', wBase end
    You are not authorized to post a reply.