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

Home » Public Forums » archive » Re: Can't position modal compound widget (such as cw_form)
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: Can't position modal compound widget (such as cw_form) [message #14686] Tue, 23 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Massimo Grion (mgrion@esrin.esa.it) writes:

> Using cw_form as a modal dialog, the widget always places itself on the
> top left corner of the screen. Is there a way to center it, without
> using cw_form inside an other widget?

I'd just modify the CW_FORM code (it's in the lib directory)
with maybe an XOffSet and YOffSet keyword. Then just set the
offsets on the temporary base widget that is created from
these values. This would take two minutes.

Here's a little utility routine Dick wrote to center
the top-level base of a widget. You could even use this.
Just call this routine with the top-level base identifier
before the widget hierarchy is realized.

CenterTLB, tlb
Widget_Control, tlb, /Realize

Cheers,

David

--
PRO CenterTLB, tlb

Device, Get_Screen_Size=screenSize
xCenter = screenSize(0) / 2
yCenter = screenSize(1) / 2

geom = Widget_Info(tlb, /Geometry)
xHalfSize = geom.Scr_XSize / 2
yHalfSize = geom.Scr_YSize / 2

Widget_Control, tlb, XOffset = xCenter-xHalfSize, $
YOffset = yCenter-yHalfSize

END ;; CenterTLB
--

David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Previous Topic: multipanel
Next Topic: Re: Can't create pixmap

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

Current Time: Thu Oct 09 23:58:54 PDT 2025

Total time taken to generate the page: 1.36122 seconds