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

Home » Public Forums » archive » Re: Don't retrieve !D.Y_VSIZE too quickly
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: Don't retrieve !D.Y_VSIZE too quickly [message #81981 is a reply to message #81979] Sun, 04 November 2012 01:38 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le dimanche 4 novembre 2012 02:59:03 UTC+1, wlandsman a écrit :
> 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

This cannot be repeated in my configuration:
{ x86 Win32 Windows Microsoft Windows 8.2.1 Aug 20 2012 32 64}
IDL> testwin
1600 900
870 870
870 870

More likely a MacOS problem than an IDL one.
By the way, what "getprimaryscreensize()" function is exactly doing (that is not a standard IDL function)?

Cheers,
alain.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Help with FOR ...DO BEGIN..........I'M A BEGINNER, begging for some help!!!!!
Next Topic: Adding Color Bars to KML Files

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

Current Time: Sat Oct 11 08:12:42 PDT 2025

Total time taken to generate the page: 0.40725 seconds