widget positioning [message #18392] |
Thu, 30 December 1999 00:00  |
Patty Howell
Messages: 3 Registered: December 1999
|
Junior Member |
|
|
Hi All,
Dumb widget question #547:
How do you position widgets on the screen? Every time I run the
procedure, the baseId appears in a different location, sometimes covered
up by another window.
Thanks!
Patty
|
|
|
Re: widget positioning [message #18514 is a reply to message #18392] |
Wed, 05 January 2000 00:00  |
Michael Werger
Messages: 34 Registered: May 1997
|
Member |
|
|
Hans-J�rgen Hahne wrote:
>
>> my code looks like this:
>
> WID_BASE_0 = Widget_Base( GROUP_LEADER=wGroup, UNAME='WID_BASE_0' $
> ,YOFFSET=500 ,SCR_XSIZE=453 ,SCR_YSIZE=246 ,TITLE='IDL-Wu' $
> ,SPACE=3 ,XPAD=3 ,YPAD=3, TLB_FRAME_ATTR=11)
>
> you need the XOFFSET, YOFFSET relatively to the monitor screen.
>
> I would like to know the window-number of that widget-window. Who knows it?
>
> Hans.
Hy, again,
What do you refer to by window-number? If you think of the complete
widget (defined by the widget_base function and all subsequent
child widgets), you have the window number, better widget ID by
wid_base_0 in the example above. If you have a draw window inside
this widget group, then you get this via (example only):
uvalue = {UVALUE,$
xsize:0L,$
ysize:0L,$
draw_window:0L}
base = WIDGET_BASE( TITLE = 'I love Y2k',$
/COLUMN, $
XPAD = 10, YPAD = 10, $
SPACE = 10)
draw = WIDGET_DRAW(base,$
XSIZE = uvalue.xsize, YSIZE = uvalue.ysize,$
RETAIN = 2, $
/BUTTON_EVENTS)
WIDGET_CONTROL, draw, GET_VALUE = tmp
uvalue.draw_window = tmp
wset,uvalue.draw_window
here uvalue.draw_window contains the number of the draw widget.
I use this structure because I can put this then into the
UVALUE of the base widget:
WIDGET_CONTROL, base, SET_UVALUE=PTR_NEW(uvalue),/NO_COPY
and use this easily in subroutines afterwards.
Michael
--
Dr. Michael Werger ------------o
ESA ESTEC & Praesepe B.V. |
Astrophysics Division mwerger@astro.estec.esa.nl|
| Postbus 299 http://astro.estec.esa.nl |
| 2200 AG Noordwijk +31 71 565 3783 (Voice)
o------------------- The Netherlands +31 71 565 4690 (FAX)
|
|
|