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

Home » Public Forums » archive » window position / screen size
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: Window position [message #6293 is a reply to message #142] Wed, 22 May 1996 00:00 Go to previous messageGo to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Matthew Larkum <larkum@pyl.unibe.ch> wrote:
>
> Does anyone know how to find the position of an IDL window?
> That is, obtaining the information you set with:
>
> window, xpos=200, ypos=200
>
> back from the system and hopefully containing any user adjustments
> in the mean time.
>

One way is to use the widget creation routines to create the window:

b = widget_base( xoffset=xpos, yoffset=ypos )
d = widget_draw( b, xsize=512, ysize=512 )
widget_control, b, /realize
widget_control, d, get_value=window_id

Then you can use WIDGET_CONTROL to get info on the top-level-base:

widget_control, b, tlb_get_offset=xy_pos ; xy_pos=lonarr(2)
widget_control, b, tlb_get_size=xy_size ; xy_size=lonarr(2)

You can also get info using the GEOMETRY keyword to WIDGET_INFO().

You can reposition the widget with TLB_SET_OFFSET keyword to
WIDGET_CONTROL().

I never use IDL's WINDOW command because you have very little
control once you've made the window. It would be simple to make
a procedure to use the widget-creation routines to make a new
window and return the TLB widget ID (maybe as keyword). I do
something similar to this in all of my programs.

Hope this helps.

Dave Foster
foster@bial1.ucsd.edu
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Window position
Next Topic: Re: efficient use of call_external

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

Current Time: Fri Oct 10 16:24:35 PDT 2025

Total time taken to generate the page: 1.20100 seconds