Re: WIDGET_MESSAGE question [message #11410] |
Tue, 07 April 1998 00:00 |
mallors
Messages: 76 Registered: November 1997
|
Member |
|
|
In article <352A475E.41C67EA6@ll.mit.edu>,
Dan Peduzzi <peduzzi@ll.mit.edu> writes:
> I would like to center a dialog on the display using
>
> result = WIDGET_MESSAGE('error message',/ERROR)
>
> The manuals indicate that I can specify a "dialog parent" widget
> over which to position the dialog, but I don't have any other
> widgets currently realized.
>
> Is there a simple way to control the placement of such a
> dialog, without creating additional "temporary" widgets?
>
>
I have a routine to place a widget at a specified
location -- see place_menu.pro at
http://cspar.uah.edu/~mallozzir/idl/idl.html
I don't know how you can do it with a DIALOG_MESSAGE,
though, since you don't have access to the widget id.
-bob
--
Robert S. Mallozzi
http://cspar.uah.edu/~mallozzir/
|
|
|
Re: WIDGET_MESSAGE question [message #11411 is a reply to message #11410] |
Tue, 07 April 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Dan Peduzzi (peduzzi@ll.mit.edu) writes:
> I would like to center a dialog on the display using
>
> result = WIDGET_MESSAGE('error message',/ERROR)
>
> The manuals indicate that I can specify a "dialog parent" widget
> over which to position the dialog, but I don't have any other
> widgets currently realized.
>
> Is there a simple way to control the placement of such a
> dialog, without creating additional "temporary" widgets?
This kind of thing is quite simple to write yourself. In my
widget programming courses it doesn't take more than a half
hour, even with people who have never written a modal dialog
widget.
Use the Device command with the Get_Screen_Size keyword
to get the size of your display. Find out the size of your
widget with the Widget_Info command and the Geometry keyword,
then use the offset keywords to position your dialog in the
center of the display. Use a pointer to "store" the answer
for return after the dialog has been destroyed.
Details can be found in my book or by examining the code
available on my web page. See, for example, the GetData
program:
ftp://ftp.dfanning.com/pub/dfanning/outgoing/coyote/getdata. pro
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|