[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: X window display sizes
- Subject: Re: X window display sizes
- From: Liam Gumley <Liam.Gumley(at)ssec.wisc.edu>
- Date: Fri, 19 Nov 1999 13:26:25 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: Space Science and Engineering Center, University of Wisconsin-Madison
- References: <3835D0E3.21FB@gecm.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:17398
your name wrote:
> There was an earlier question about finding the size of the display
> screen. I am familiar with David's answer:-
> DEVICE, GET_SCREEN_SIZE = My_screen_size
> However, I am running under OpenVMS, CDE, Motif with X-windows. In my
> application, I create displays on a number of display devices using the
> DISPLAY_NAME keyword to WIDGET_BASE.
> Does anyone know how I can find the size of these (remote) displays?
> Some of these displays are PCs with an X-window emulator, so the
> resolution may be changed by the users without the knowledge of the
I don't know of any way to do this using IDL commands. The only
information you can return about a widget on a remote display seems to
be the geometry of the widget itself, e.g.
base = widget_base(display_name='merlin.gecm.com:0')
text = widget_text(base, value='Hello world')
widget_control, base, /realize
info = widget_info(base, /geometry)
However you can find the remote display dimensions using a spawn
display = 'merlin.hp.com:0'
command = string(display, $ ; csh syntax
format='("setenv DISPLAY ", a, " ; xdpyinfo | fgrep dimensions")')
command = string(display, $ ; ksh syntax
format='("export DISPLAY=", a, " ; xdpyinfo | fgrep dimensions")')
spawn, command, result
dimensions: 1280x1024 pixels (361x288 millimeters)
I'll leave it as an exercise for the reader to extract the dimension
values from the result string.
(1) This only works if your host system (where IDL is running) is UNIX.
(2) If you don't have permission to create graphics on the remote
display, the spawn command hangs (at least it does on my Linux box,
where the remote display is an NT box running XWin-32).
Liam E. Gumley
Space Science and Engineering Center, UW-Madison