Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: wxPerl behavior on Win32

by Anonymous Monk
on Oct 27, 2014 at 21:38 UTC ( [id://1105215]=note: print w/replies, xml ) Need Help??


in reply to wxPerl behavior on Win32

When running on linux, my wxPerl application looks well. But running this script on Windows XP shocks me:

Why? Please explain

#!/usr/bin/perl -- use strict; use warnings; use Wx; my $app = Wx::SimpleApp->new; my $frame = Wx::Frame->new( undef, -1, "", ); $frame->SetBackgroundColour( Wx::wxBLACK() ); $frame->SetSizer( Wx::BoxSizer->new( Wx::wxVERTICAL() ) ); for(1..10){ my $t = Wx::StaticText->new( $frame , -1, "yo ".rand, ) ; $t->SetBackgroundColour( Wx::wxRED() ); my $b = Wx::Button->new( $frame , -1, rand." yo", ); $frame->GetSizer->Add( $t, 0, 0 ); $frame->GetSizer->Add( $b, 0, Wx::wxEXPAND() ); } $frame->Show(1); $app->SetTopWindow( $frame ); $app->MainLoop;

Replies are listed 'Best First'.
Re^2: wxPerl behavior on Win32
by solomon243 (Novice) on Oct 28, 2014 at 19:35 UTC
    >>> Why? Please explain

    it wasn't pleasant to me that near widgets a background light, and primary color of a frame - dark

    and so was only under windows

      it wasn't pleasant to me that near widgets a background light, and primary color of a frame - dark

      and so was only under windows

      FWIW, I usually solve that problem by making your "$frame" a wxPanel

      The background ends up being the usual panel light grey of wxSYS_COLOUR_MENU /
      #D4D0C8
      instead of the darker frame/MDI "grey" of wxSYS_COLOUR_APPWORKSPACE
      #D4D0C8

        >> FWIW, I usually solve that problem by making your "$frame" a wxPanel


        this is complete solution!
        my $bigbutton = Wx::Button->new( $frame, 1, 'Вып&#10 +86;лнить расч&# +1077;т', [-1,-1], [-1,-1]); my $mass_label = Wx::StaticText->new($frame, 2, 'Ваш + вес:',[-1,-1], [-1,-1]); my $drink_label = Wx::StaticText->new($frame, 4, 'Пр&#1077 +;дпочитаем&#109 +9;й напиток:',[-1,-1] +, [-1,-1]); my $mass_entry = Wx::TextCtrl->new($frame, 3, '',[-1,-1], [-1,-1]);

        no wxPanel needed! Now my code works equally on all platforms! THX, Anonymous Monk

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1105215]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-24 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found