Re: X window display sizes [message #17930] |
Fri, 19 November 1999 00:00 |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
David Fanning wrote:
> I don't know. I think the realize-the-upmapped-
> draw-widget method used in GET_SCREEN_SIZE should
> work everywhere. There is even a keyword that will
> enquire of a remote display, I think.
You're right. I could not get the get_screen_size function to work (IDL
5.1), but extracting the relevant parts worked fine:
base = widget_base(display='redback:0', map=0)
draw = widget_draw(base, xsize=10, ysize=10, graphics_level=2)
widget_control, base, /realize
widget_control, draw, get_value=owindow
owindow->getproperty, screen_dimensions=dims
print, dims
1024.00 768.000
obj_destroy, owindow
widget_control, base, /destroy
Cheers,
Liam.
--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Re: X window display sizes [message #17934 is a reply to message #17930] |
Fri, 19 November 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:
> 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.
I don't know. I think the realize-the-upmapped-
draw-widget method used in GET_SCREEN_SIZE should
work everywhere. There is even a keyword that will
enquire of a remote display, I think.
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
|
|
|
Re: X window display sizes [message #17936 is a reply to message #17930] |
Fri, 19 November 1999 00:00  |
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
|
|
|