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

Home » Public Forums » archive » Don't retrieve !D.Y_VSIZE too quickly
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
Don't retrieve !D.Y_VSIZE too quickly [message #81982] Sat, 03 November 2012 18:59
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
For the second time this week, I found a need to repeat an IDL command for it to take full effect. Below is the sample program on my Mac

pro testwin

print,getprimaryscreensize()
window,xsize=870,ysize=870,retain=2

print,!D.y_size,!D.y_vsize
print,!D.y_size,!D.y_vsize

return
end

The output is

IDL> testwin
1440 878
870 870
856 856

So when I first ask to print !D.y_vsize it returns 870, but when I immediately ask again it returns 856.
This problem is avoided if I put any sort of wait statement after opening the window. It appears to take a finite time, after I ask IDL to open a window with a Ysize of 870 pixels, to realize that the toolbar is using up 22 pixels and adjust !Y.V_SIZE accordingly.

This delay is what may have caused the difficulty in getting the Mac useful screen size
( http://www.idlcoyote.com/code_tips/goldilocks.html ). My solution for getting the useful Mac screen size would now be the following:

function getmacsize
xy = get_screen_size()
window,xsize=xy[0],ysize=xy[1],/free
wait,0.01
out = [!D.x_vsize,!D.Y_vsize]
wdelete,!D.window
return,out
end

Of course, this will give flashing but at least it will give the right answer.


Cheers, -Wayne
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help with FOR ...DO BEGIN..........I'M A BEGINNER, begging for some help!!!!!
Next Topic: Re: Help with FOR ...DO BEGIN..........I'M A BEGINNER, begging for some help!!!!!

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

Current Time: Wed Oct 08 13:32:31 PDT 2025

Total time taken to generate the page: 0.00656 seconds