R
R
RaMzz2018-02-27 21:32:09
Perl
RaMzz, 2018-02-27 21:32:09

WxPerl how to open a text file?

Tell me how to open a text file and display it in a listbox

use Wx;
package MyApp;

use vars qw(@ISA);

@ISA=qw(Wx::App);

sub OnInit {
  my( $this ) = @_;

  
  my( $frame ) = MyFrame->new();

  
  $this->SetTopWindow( $frame );
  
  $frame->Show( 1 );

  1;
}

package MyFrame;
use vars qw(@ISA);
@ISA=qw(Wx::Frame);

sub new {
  my( $class ) = shift;
    my $this = $class->SUPER::new( undef, -1, 'form title', [-1,-1], [158, 252]);
    my $panel = Wx::Panel->new($this, -1);

    my $listbox1_list = [''];
    $this->{listbox1} = Wx::ListBox->new($panel, -1, [16,8], [118, 164], $listbox1_list);
    $this->{listbox1}->SetBackgroundColour(Wx::Colour->new(255, 255, 255));

    $this->{button1} = Wx::Button->new($panel, -1, 'button',[24,176], [108, 37]);


  $this;
}

package main;	
my( $app ) = MyApp->new();
# start processing events
$app->MainLoop();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question