Sergy Stouk
asked on
Get screen Size
I am evaluating the use Win32::GUI module.
Does anyone know how can I get the size of the Screen (the resolution) in order to position my new window in the center of the screen?
Some example would be appriciated.
thanks.
Does anyone know how can I get the size of the Screen (the resolution) in order to position my new window in the center of the screen?
Some example would be appriciated.
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You gave me a link to the page, which had the answer I need.
I tested TK and found out that you can create nice Windows with it, but they will look like an emulation of Unix Desktop on Windows platform.
I want a professionally looking Windows GUI Application, which Win32::Gui perfectly provides with, because it accesses the native Windows dlls for doing it.
That's why I stick with Win32-Gui and am happy with.
All the basic controls are there, enough for working with.
I am thankful you pointed out the link where I got the answer and since I am using version 0.665 of Win32::GUI this function might had been fixed and worked perfectly for me. I simply did not know it.
Thanks again.
I tested TK and found out that you can create nice Windows with it, but they will look like an emulation of Unix Desktop on Windows platform.
I want a professionally looking Windows GUI Application, which Win32::Gui perfectly provides with, because it accesses the native Windows dlls for doing it.
That's why I stick with Win32-Gui and am happy with.
All the basic controls are there, enough for working with.
I am thankful you pointed out the link where I got the answer and since I am using version 0.665 of Win32::GUI this function might had been fixed and worked perfectly for me. I simply did not know it.
Thanks again.
With JavaScript you can get the screensize and there are also scripts available that will center the new window, regardless of the screen size. JavaScript can also very easily be programmed in your Perl script.
Use the following JavaScript code to open a new window centered on the screen, regardless of the screensize:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,
{
if(pos=="random")
{
LeftPosition=(screen.width
}
if(pos=="center")
{
LeftPosition=(screen.width
}
else if((pos!="center" && pos!="random") || pos==null)
{
LeftPosition=0;TopPosition
}
settings='width='+w+',heig
win=window.open(mypage,myn
}
// -->
</SCRIPT>
If you want more scripts for popup windows, have a look at http://www.dynamicdrive.com/dynamicindex8/popwin.htm
Hope this helps...
BA