L
lsyx
Code:
##################
#!/usr/bin/perl
use strict;
use warnings;
use Wx;
use threads;
use threads::shared qw/shared_clone/;
package MyFrame;
use Wx qw(wxTE_MULTILINE);
use base qw/Wx::Frame/;
sub new
{
my ( $class, $frame, $title, $x, $y, $w, $h ) = @_;
my ($this) = $class->SUPER::new(
$frame, -1, $title,
Wx:oint->new( $x, $y ),
Wx::Size->new( $w, $h ) );
my $notebook = Wx::Notebook->new( $this, -1 );
my $log = Wx::TextCtrl->new(
$notebook, -1, "test\n",
[ 10, 10 ],
[ 500, 300 ],
wxTE_MULTILINE
);
$this;
} ## end sub new
#}
#{
package MyApp;
use strict;
use base qw/Wx::App/;
sub OnInit
{
my ($this) = @_;
my ($frame) =
MyFrame->new( undef, "test", 50, 50, 540,
430 );
$frame->SetSizeHints( 500, 425 );
$frame->Show(1);
$this->SetTopWindow($frame);
1;
} ## end sub OnInit
package main;
my $gui = MyApp->new();
my $worker = threads->create( \&work );
$gui->MainLoop();
sub work {
print "abcdefgh\n";
}
##############
how to put
work() 's out text : abcdefgh
into
my $log = Wx::TextCtrl 's window ?
thanks for your help.
##################
#!/usr/bin/perl
use strict;
use warnings;
use Wx;
use threads;
use threads::shared qw/shared_clone/;
package MyFrame;
use Wx qw(wxTE_MULTILINE);
use base qw/Wx::Frame/;
sub new
{
my ( $class, $frame, $title, $x, $y, $w, $h ) = @_;
my ($this) = $class->SUPER::new(
$frame, -1, $title,
Wx:oint->new( $x, $y ),
Wx::Size->new( $w, $h ) );
my $notebook = Wx::Notebook->new( $this, -1 );
my $log = Wx::TextCtrl->new(
$notebook, -1, "test\n",
[ 10, 10 ],
[ 500, 300 ],
wxTE_MULTILINE
);
$this;
} ## end sub new
#}
#{
package MyApp;
use strict;
use base qw/Wx::App/;
sub OnInit
{
my ($this) = @_;
my ($frame) =
MyFrame->new( undef, "test", 50, 50, 540,
430 );
$frame->SetSizeHints( 500, 425 );
$frame->Show(1);
$this->SetTopWindow($frame);
1;
} ## end sub OnInit
package main;
my $gui = MyApp->new();
my $worker = threads->create( \&work );
$gui->MainLoop();
sub work {
print "abcdefgh\n";
}
##############
how to put
work() 's out text : abcdefgh
into
my $log = Wx::TextCtrl 's window ?
thanks for your help.