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

Home » Public Forums » archive » Re: X window display sizes
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: X window display sizes [message #17936 is a reply to message #17930] Fri, 19 November 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
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
> system.

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)
print, info

However you can find the remote display dimensions using a spawn
command, e.g.

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
print, 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.

Caveats:
(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).
Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Direct Printing Problem
Next Topic: Re: IMDISP: A smart image display program

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

Current Time: Thu Oct 09 03:49:53 PDT 2025

Total time taken to generate the page: 0.64367 seconds