use Wx 0.15 qw[:allclasses]; use strict; package waage; use Wx qw[:everything]; use base qw(Wx::Frame); use strict; sub new { my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; # begin wxGlade: waage::new $style = wxDEFAULT_FRAME_STYLE unless defined $style; $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $style, $name ); $self->{label_text} = Wx::StaticText->new($self, -1, "Bitte Warten .", wxDefaultPosition, wxDefaultSize, ); my $timer = Wx::Timer->new($self, -1); $timer->Start(500); Wx::Event::EVT_TIMER($self, -1 , \&wait); $self->__set_properties(); $self->__do_layout(); # end wxGlade return $self; } sub __set_properties { my $self = shift; # begin wxGlade: waage::__set_properties $self->SetSize(Wx::Size->new(220, 100)); $self->{label_text}->SetMinSize(Wx::Size->new(150, 19)); $self->{label_text}->SetFont(Wx::Font->new(12, wxDEFAULT, wxNORMAL, wxBOLD, 0, "")); # end wxGlade } sub __do_layout { my $self = shift; # begin wxGlade: waage::__do_layout $self->{sizer_1} = Wx::BoxSizer->new(wxVERTICAL); $self->{sizer_1}->Add($self->{label_text}, 0, wxTOP|wxALIGN_CENTER_HORIZONTAL, 35); $self->SetSizer($self->{sizer_1}); $self->Layout(); # end wxGlade } sub wait { my ($self, $event) = @_; # wxGlade: Ueberwachung::gewicht my $text = $self->{label_text}->GetLabel; if($text eq "Bitte Warten .") { $self->{label_text}->SetLabel("Bitte Warten .."); } if($text eq "Bitte Warten ..") { $self->{label_text}->SetLabel("Bitte Warten ..."); } if($text eq "Bitte Warten ...") { $self->{label_text}->SetLabel("Bitte Warten ."); } # end wxGlade } # end of class waage 1; 1; package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $waage = waage->new(); $app->SetTopWindow($waage); $waage->Show(1); $app->MainLoop(); # liegt hier der Fehler? } 1; package MyFrame; use Wx qw[:everything]; use base qw(Wx::Frame); use module::rs232; use JSON; use module::json_write; use module::json_read; use module::kasse; use module::abbruch; use strict; sub new { our( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; # begin wxGlade: MyFrame::new $style = wxMAXIMIZE_BOX unless defined $style; our @material = ws($ARGV[1]); # Material und Preis auslesen (json_read) our @gewicht = wiegen(2); our $preis = kosten($gewicht[0], $material[0], $material[1]); # ausrechnen der Gesamtkosten our $preis_gesamt; ...