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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Don't retrieve !D.Y_VSIZE too quickly [message #81976] Sun, 04 November 2012 06:06
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le dimanche 4 novembre 2012 14:55:36 UTC+1, wlandsman a écrit :
> Here's the simplest form of the test program
>
>
>
> pro testwin
>
> window,xsize=870,ysize=870
>
> print,!D.y_size,!D.y_vsize
>
> print,!D.y_size,!D.y_vsize
>
> return
>
> end
>
>
>
>
>
> IDL> testwin
>
> % Compiled module: TESTWIN.
>
> 870 870
>
> 856 856
>
>
>
> The reason I previously included get_screen_size is that the problem only occurs when opening a window on my machine with a Y size between 856 and 878, in other words between the full screen size and the effective screen size which accounts the 22 pixels needed for the menubar.
>
>
>
>
>
> On Sunday, November 4, 2012 7:09:46 AM UTC-5, alx wrote:
>
>> The observed delay might be related to garbage collection of the object that is created within the call of getprimaryscreensize().
>
>>
>
>> In 'testwin', you might exchange this function with original IDL's get_screen_size to check whether a delay is still there.
>
>>
>
>> Alain.

Ok. Definitely different on Windows & IDL 8.2.1 :

IDL> testwin
% Compiled module: TESTWIN.
870 870
870 870
Re: Don't retrieve !D.Y_VSIZE too quickly [message #81977 is a reply to message #81976] Sun, 04 November 2012 05:55 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Here's the simplest form of the test program

pro testwin
window,xsize=870,ysize=870
print,!D.y_size,!D.y_vsize
print,!D.y_size,!D.y_vsize
return
end


IDL> testwin
% Compiled module: TESTWIN.
870 870
856 856

The reason I previously included get_screen_size is that the problem only occurs when opening a window on my machine with a Y size between 856 and 878, in other words between the full screen size and the effective screen size which accounts the 22 pixels needed for the menubar.


On Sunday, November 4, 2012 7:09:46 AM UTC-5, alx wrote:
> The observed delay might be related to garbage collection of the object that is created within the call of getprimaryscreensize().
>
> In 'testwin', you might exchange this function with original IDL's get_screen_size to check whether a delay is still there.
>
> Alain.
Re: Don't retrieve !D.Y_VSIZE too quickly [message #81978 is a reply to message #81977] Sun, 04 November 2012 04:09 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le dimanche 4 novembre 2012 12:56:42 UTC+1, wlandsman a écrit :
> Yes. It is definitely only a problem with IDL on a Mac (though I'd still call it an IDL problem rather than a Mac OS x one.)
>
>
>
> getprimaryscreensize() is a Coyote program, though for the Mac it is equivalent to Device, Get_Screen_Size=theSize It is based on the discussions in this thread http://tinyurl.com/adz4v8p.
>
>
>
> --Wayne
>
>
>
> On Sunday, November 4, 2012 3:38:54 AM UTC-5, alx wrote:
>
>> Le dimanche 4 novembre 2012 02:59:03 UTC+1, wlandsman a écrit :
>
>>
>
>>
>
>>
>
>> 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.

The observed delay might be related to garbage collection of the object that is created within the call of getprimaryscreensize().
In 'testwin', you might exchange this function with original IDL's get_screen_size to check whether a delay is still there.
Alain.
Re: Don't retrieve !D.Y_VSIZE too quickly [message #81979 is a reply to message #81978] Sun, 04 November 2012 03:56 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Yes. It is definitely only a problem with IDL on a Mac (though I'd still call it an IDL problem rather than a Mac OS x one.)

getprimaryscreensize() is a Coyote program, though for the Mac it is equivalent to Device, Get_Screen_Size=theSize It is based on the discussions in this thread http://tinyurl.com/adz4v8p.

--Wayne

On Sunday, November 4, 2012 3:38:54 AM UTC-5, alx wrote:
> Le dimanche 4 novembre 2012 02:59:03 UTC+1, wlandsman a écrit :
>
>
>
> 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.
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:13:46 PDT 2025

Total time taken to generate the page: 0.00731 seconds