wxPerl monitor size in pixels
console version
perl -MWx -le " print join q[x], Wx::ScreenDC ->new-> GetSizeWH "
popup with console
perl -MWx -le " Wx::MessageBox( join q[x], Wx::ScreenDC ->new-> GetSiz +eWH ) "
popup without console (win32)
wperl -MWx -le " Wx::MessageBox( join q[x], Wx::ScreenDC ->new-> GetSi +zeWH ) "

Replies are listed 'Best First'.
Re: wxPerl monitor size in pixels
by stefbv (Priest) on May 29, 2011 at 19:51 UTC

    On the same note ... ;)

    Perl Tk monitor size in pixels

    Console version

    perl -MTk -le '$w=tkinit; print join q[x],$w->screenwidth,$w->screenhe +ight'

    Popup version, no console, ...

    perl -MTk -le '$w=tkinit; $w->Dialog(-text => join q[x],$w->screenwidt +h,$w->screenheight)->Show;'

    Same values (1920x1080) for wxPerl version as for Tk version on my box.

      This also gives the same wrong result 1707x960, but my screen is 2560x1440 pixels!?

      (I am using: The Dell UltraSharpT U2711 27" Monitor with resolution of 2560 x 1440 (WQHD))

        I think we can conclude that is not a wxWidgets or Tk problem, it has to be on a higher level.

        On my box, GNU/Linux with X and KDE4, if I run the next command and click on the desktop the result is the same.

        xwininfo | grep geometry

        Gives:

        -geometry 1920x1080+0+0

        Update: ... lower level ... :)

Re: wxPerl monitor size in pixels
by Anonymous Monk on May 29, 2011 at 06:42 UTC

    Running this gives the result 1707x960, but my screen is 2560x1440 pixels!?

      Don't know, it works for me.
      perl -MWx -e "print join q[ ] , $Wx::VERSION, Wx::wxVERSION_STRING" 0.99 wxWidgets 2.8.12
      You could try
      my $s = Wx::GetDisplaySize(); print join 'x', map { $s->$_ } qw' x y '; print "\n"; __END__
      Whatever the issue is, wxWidgets team would know

        Gives the same result 1707x960, but my screen is 2560x1440 pixels!?

        Can be a problem in wxWidgets.

        perl -MWx -e "print join q[ ] , $Wx::VERSION, Wx::wxVERSION_STRING "

        prints: 0.99 wxWidgets 2.8.12