[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: determining the display size (IDL)
- Subject: Re: determining the display size (IDL)
- From: davidf(at)dfanning.com (David Fanning)
- Date: Thu, 18 Nov 1999 15:58:05 -0700
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <38333117.5F9A419A@hpl.hp.com> <MPG.129ce5a38d765b1e989975@news.frii.com> <811uo8$qr8$1@hammer.msfc.nasa.gov>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:17376
Robert S. Mallozzi (mallors@msfc.nasa.gov) writes:
> You might want use the GET_SCREEN_SIZE () function
> instead, as it won't crash if the device is
> not set "properly":
>
> IDL> PRINT, !D.NAME
> X
> IDL> DEVICE, GET_SCREEN_SIZE = s & PRINT, s
> 1024 768
> IDL> s = GET_SCREEN_SIZE () & PRINT, s
> % Compiled module: GET_SCREEN_SIZE.
> 1024.00 768.000
> IDL> SET_PLOT, 'PS'
> IDL> DEVICE, GET_SCREEN_SIZE = s & PRINT, s
> % Keyword GET_SCREEN_SIZE not allowed in call to: DEVICE
> % Execution halted at: $MAIN$
> IDL> PRINT, !D.NAME
> PS
> IDL> s = GET_SCREEN_SIZE () & PRINT, s
> 1024.00 768.000
Whoa! Did you see the code for GET_SCREEN_SIZE!?
They realize an *unmapped* object draw widget
on the device. Then get the screen dimensions
from the window object. Nice trick, because
devices that don't support windows don't complain
until a window actually shows up on the display,
which this one never does.
Who said objects weren't powerful! :-)
Cheers,
David
--
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