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

Home » Public Forums » archive » How to pick a window?
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: How to pick a window? [message #23567 is a reply to message #23502] Tue, 30 January 2001 12:48 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
All I have to say is, a "smart" widget direct graphics window is very
simple to achieve.
The following "two-line" code easily sets the "pseudo"-DG window to have
focus. Since Andrew's windows will be created from some other code, it
is very easy to store instructions for plotting windows at the time of
their creation.
The basic idea of the example below is to make a window *act* when
clicked on, and keep it looking and behaving *exactly* as a standard DG
IDL window, to keep William happy and unaware :-) In my example, they
set focus to themselves and allow resizing. Just use "smart_w" instead
of "window, /free". That's it. Then use Plot, Oplot, Xyouts, Contour - whatever.

;********************
pro smart_w_event, event
widget_control, event.top, get_uvalue=win_id
wset, win_id
if tag_names(event, /STRUCTURE_NAME) EQ 'WIDGET_BASE' then $
widget_control, widget_info(event.id, /child), $
draw_xsize=event.x, draw_ysize=event.y
end
;********************
pro smart_w
top_base = widget_base(/kbrd_focus_event, /tlb_size_event)
draw = widget_draw(top_base, xsize=600, ysize=400, retain=2)
widget_control, top_base, /realize
widget_control, draw, get_value=win_id
widget_control, top_base, set_uvalue=win_id, $
tlb_set_title='IDL '+strcompress(win_id, /rem)
xmanager, 'smart_w', top_base, /no_block
end
;********************

Anyway, don't let the word "widget" scare you out of using IDL. Wait
till you get to objects :-)
Cheers,
Pavel

William Thompson wrote:
>
> Let me just say that if IDL were written as an environment where everything
> *had* to be done as a widget program, we probably would *not* be using IDL
> today. We'd be using something else more forgiving. And I say this as someone
> who's written a fair number of widget programs in his time.
>
> William Thompsonn
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: window menu / context menu
Next Topic: Re: COMMON block question

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

Current Time: Fri Oct 10 17:19:08 PDT 2025

Total time taken to generate the page: 0.31993 seconds