; ; 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