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

Home » Public Forums » archive » X device screen size
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
X device screen size [message #203] Wed, 19 February 1992 11:32
jeb is currently offline  jeb
Messages: 2
Registered: February 1992
Junior Member
hofer@urz.unibas.ch (Remo Hofer) writes:
>
> Is there some way to get the screen size of the X display? I use pv-wave 3.10 ...
>
>


New in PV-WAVE 3.1, it is very easy to obtain the size of the screen. This
information is stored in a structure "!display_size". This feature is
documented in the new PV-WAVE Technical Reference Manual. Note that you
need to execute some graphics command (ie. loadct, window, etc.) to assign
the information from the X server to the variable.



PRINT,!DISPLAY_SIZE
;{ 0 0}

Execute some graphic command to assign values to the structure
LOADCT,0

PRINT,!DISPLAY_SIZE
;{ 1152 900}

PRINT,'Display Size: X =',!DISPLAY_SIZE.X,' Y =',!DISPLAY_SIZE.Y
;Display Size: X = 1152 Y = 900


---
--
-----------------------------------
John Bee, Precision Visuals, Inc.
303/530-9000 (Voice)
email: boulder.colorado.edu!pvi!jeb
Re: X device screen size [message #204 is a reply to message #203] Wed, 19 February 1992 08:05 Go to previous message
steve is currently offline  steve
Messages: 19
Registered: March 1991
Junior Member
To be fair to PVI, I thought I should post a followup. I just got a
very nice call from PV-WAVE Customer Support (thanks Rona). PV-WAVE v3.10
does indeed have a way to get the screen size. There's a system variable
!DISPLAY_SIZE, which has the screen size as soon as you do some sort of
window operation. It's right there in black&white on page 3-11, and in
the index under 'Display, determining size of'.

-steve

--
+---------+------------------------------------------------- -------+---------+
| | Steve Swales (716) 275-7730,-3194,-5101 | |
| | steve@aldur.lle.rochester.edu (128.151.32.171) | |
| | University of Rochester 250 East River Road | |
| | Laboratory for Laser Energetics Rochester, NY 14623 | |
+---------+------------------------------------------------- -------+---------+
Re: X device screen size [message #208 is a reply to message #203] Fri, 14 February 1992 01:18 Go to previous message
hofer is currently offline  hofer
Messages: 16
Registered: April 1991
Junior Member
In article <1992Feb14.101422.10022@urz.unibas.ch>,
hofer@urz.unibas.ch (Remo Hofer) writes:
> Thanks for all answers.
> PV-WAVE doesn't know (yet) about DEVICE, GET_SCREEN_SIZE=variable.
> PVI are you listening? ;-)
> The window hack with DEVICE, GET_WINDOW_POSITION=w that Steve Swales described
> does indeed work. First I didn't find this keyword in my "old" 3.03 VMS
> manual. But in the new SGI 3.10 manual it was listed.

What I forgot to say is, that it works on the 3.03 version even if it isn't
documented in the corresponding manual. So I wonder what's the manual
update policy of PVI?

Remo Hofer
--
RFC822: <hofer@urz.unibas.ch> or <hofer%urz.unibas.ch@CERNVAX.BITNET>
X.400: S=hofer;OU=urz;O=unibas;P=SWITCH;A=ARCOM;C=CH
HEPNET/SPAN: CHGATE::YOGI::HOFER or 20579::48130::HOFER
Re: X device screen size [message #209 is a reply to message #203] Fri, 14 February 1992 01:14 Go to previous message
hofer is currently offline  hofer
Messages: 16
Registered: April 1991
Junior Member
In article <1992Feb13.192731.7015@galileo.cc.rochester.edu>,
steve@alder.lle.rochester.edu (Steve Swales) writes:
> In article <1992Feb13.104900.10013@urz.unibas.ch>,
> hofer@urz.unibas.ch (Remo Hofer) writes:
>> Is there some way to get the screen size of the X display?
>
> We asked PVI about this, and their reply was that they felt the user shouldn't
> need to know. THANKS A LOT!!!
>
> we hacked this up to trick PV-WAVE into supplying the desired information.

> In article <13FEB199216243050@stars.gsfc.nasa.gov>,
> thompson@stars.gsfc.nasa.gov (William Thompson, code 682.1, x2040) writes:
> I don't know about PV-WAVE, but in IDL the call is simply
> IDL> DEVICE, GET_SCREEN_SIZE=variable

Thanks for all answers.
PV-WAVE doesn't know (yet) about DEVICE, GET_SCREEN_SIZE=variable.
PVI are you listening? ;-)
The window hack with DEVICE, GET_WINDOW_POSITION=w that Steve Swales described
does indeed work. First I didn't find this keyword in my "old" 3.03 VMS manual.
But in the new SGI 3.10 manual it was listed.
Thanks again.

Remo Hofer
--
RFC822: <hofer@urz.unibas.ch> or <hofer%urz.unibas.ch@CERNVAX.BITNET>
X.400: S=hofer;OU=urz;O=unibas;P=SWITCH;A=ARCOM;C=CH
HEPNET/SPAN: CHGATE::YOGI::HOFER or 20579::48130::HOFER
Re: X device screen size [message #211 is a reply to message #203] Thu, 13 February 1992 12:24 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
In article <1992Feb13.104900.10013@urz.unibas.ch>, hofer@urz.unibas.ch (Remo Hofer) writes...
> Is there some way to get the screen size of the X display? I use pv-wave 3.10
> on a Personal Iris.

I don't know about PV-WAVE, but in IDL the call is simply

IDL> DEVICE, GET_SCREEN_SIZE=variable

We use that to ensure that the windows we create will actually fit on the
screen.

Bill Thompson
Re: X device screen size [message #214 is a reply to message #203] Thu, 13 February 1992 11:27 Go to previous message
steve is currently offline  steve
Messages: 19
Registered: March 1991
Junior Member
In article <1992Feb13.104900.10013@urz.unibas.ch>, hofer@urz.unibas.ch (Remo Hofer) writes:
> Is there some way to get the screen size of the X display? I use pv-wave 3.10 on a
> Personal Iris. My problem is this: I want to open some centered windows (for menus)
> and a large window covering the whole screen. Since we use several different X window
> servers (other workstations used as X terminals), I cannot use some constant value
> for the screen size. I realized that the X device knows about this info, because I
> can get it on the screen with "HELP, /DEVICE", wich gives:
>
> Available graphics_devices: 4510 CGM HP LJ NULL PCL PS QMS REGIS SIXEL TEK X
> Current graphics device: X
> Server: X11.0, Silicon Graphics Inc., Release 4
> Display Depth, Size: 8 bits, (1280,1024) <-------- Here it is!!!!!
> Visual Class: PseudoColor (3)
> Bits Per RGB: 8
> Physical Color Map Entries (Used / Total): 16 / 256
> Colormap: Shared, 16 colors. Translation table: Enabled
> Dither Method: Ordered
> Write Mask: 255 (decimal) ff (hex)
> Graphics Function: 3 (copy)
> Current Font: <default>
> Default Backing Store: Pixmap.
> Window Status:
> 31) Window (100, 100), Backing store: Pixmap.
>
> But is there a way to get this info into a variable usable for any procedure?
> Thanks in advance for any help
> Greetings Remo Hofer
> --
> RFC822: <hofer@urz.unibas.ch> or <hofer%urz.unibas.ch@CERNVAX.BITNET>
> X.400: S=hofer;OU=urz;O=unibas;P=SWITCH;A=ARCOM;C=CH
> HEPNET/SPAN: CHGATE::YOGI::HOFER or 20579::48130::HOFER

We asked PVI about this, and their reply was that they felt the user shouldn't
need to know. THANKS A LOT!!!

we hacked this up to trick PV-WAVE into supplying the desired information.
It flashes four little windows up when you first call it, but otherwise works
fine for us under OpenWindows using either twm or olwm, and worked on an
X terminal we have under X11r4, though it might require slight hacking
for other server/window manager combos.

;
; FILE: screen_size.pro
; AUTHOR: Steve Swales
; DATE: January 31, 1992 (Created: January 31, 1992)
; PURPOSE: Get what PV-WAVE doesn't want us to get.
;+
; SYNOPSIS: ss = screen_size([ro[,cb]])
; DESCRIPTION: Get what PV-WAVE doesn't want us to get.
;-

function screen_size,ro,cb
common garbage, reparent_offset, screen, crazy_bottom

; first time, we find the paremeters of the screen and
; window manager offsets...
if n_elements(reparent_offset) eq 0 then begin
wpos= intarr(3,6)
for i=0,4 do begin
window,/free,xsize=2,ysize=2
device,get_window_position=w_pos
wpos(1:2,i) = w_pos
wpos(0,i) = !d.window
endfor
window,/free,xsize=2,ysize=2,xpos=0,ypos=100
device,get_window_position=w_pos
reparent_offset = w_pos - [0,100]
wpos(0,5) = !d.window
screen = intarr(2)
screen(0) = max(wpos(1,0:4)) + 2 - reparent_offset(0)
screen(1) = max(wpos(2,0:4)) + 2 - reparent_offset(1)
; this makes little sense... but seems to keep windows w/border
; on screen
if min(wpos(2,0:4)) lt 0 then begin
crazy_bottom = reparent_offset(0)-reparent_offset(1)
endif else begin
crazy_bottom = reparent_offset(0)*2
endelse
for i=0,5 do begin
wdelete,wpos(0,i)
endfor
endif
; printf,-1,'screen is',screen(0),' x',screen(1)
if n_params() gt 0 then ro = reparent_offset
if n_params() gt 1 then cb = crazy_bottom

return,screen
end

--
+---------+------------------------------------------------- -------+---------+
| | Steve Swales (716) 275-7730,-3194,-5101 | |
| | steve@aldur.lle.rochester.edu (128.151.32.171) | |
| | University of Rochester 250 East River Road | |
| | Laboratory for Laser Energetics Rochester, NY 14623 | |
+---------+------------------------------------------------- -------+---------+
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to change widget fonts ?
Next Topic: X-windows fonts

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

Current Time: Wed Oct 08 15:05:52 PDT 2025

Total time taken to generate the page: 0.00687 seconds