Newsgroups: comp.lang.idl-pvwave
From: alx <lecacheux.al...@wanadoo.fr>
Date: Sun, 4 Nov 2012 01:38:54 -0700 (PDT)
Local: Sun, Nov 4 2012 3:38 am
Subject: Re: Don't retrieve !D.Y_VSIZE too quickly
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
This cannot be repeated in my configuration:
> 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
{ 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.
Cheers,
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||