Greetings to all of you!

I have the following problem. When I run the enclose application then in 
Windows XP it shows proper background color and proper alignment of static 
text, whereas in linux it does not work at all. What I should do to obtain 
identical action in both systems?

I'm using:
Linux Wx 0.91 (AMD 64 Debian sqeeze/sid) Perl 5.10.0
Windows Wx 0.90 (XP - 32bit) Perl 5.10.0 (ActiveState)

Waldemar

=======================================
#!/usr/bin/perl

use strict;
use warnings;

use Wx qw( :everything );
use Wx::Event qw ( EVT_CHAR );
use Wx::App;

my $app   = Wx::SimpleApp->new;
my $frame = 
Wx::Frame->new(undef,-1,"mw",[-1,-1],[200,150],wxDEFAULT_FRAME_STYLE);
$frame->Center();

my      $text = Wx::TextCtrl->  
new($frame,-1,"text",[10,10],[150,30],wxALIGN_RIGHT );
        $text->SetBackgroundColour( make_color( 0xffff00 ));
        $text->SetForegroundColour( make_color( 0x0000ff ));

my      $stat = 
Wx::StaticText->new($frame,-1,"stat",[10,60],[150,30],wxALIGN_RIGHT );
        $stat->SetBackgroundColour( make_color( 0xff00ff ));
        $stat->SetForegroundColour( make_color( 0x00ff00 ));

$frame->Show( 1 );
$app->MainLoop;

sub make_color {
        my ( $kolor ) = ( shift );
        
        return undef unless $kolor;
        return undef if $kolor =~  /^no$/i;

        my $blu = $kolor % 256; $kolor = ( $kolor - $kolor % 256 ) / 256;
        my $gre = $kolor % 256; $kolor = ( $kolor - $kolor % 256 ) / 256;
        my $red = $kolor % 256;
        return new Wx::Colour( $red, $gre, $blu );
}

__END__

Reply via email to