#!perl package MyApp; use strict; use warnings; use Wx qw/:everything/; use Wx::Grid; use base qw(Wx::App); # von Wx::App ableiten sub OnInit { my $app = shift ; my $frame = Wx::Frame->new( undef, # kein Eltern-Fenster -1, # Fenter id 'Wx::Grid', # Titel [-1, -1], # Position x/y [640, 480] # Größe x/y ); my $font = Wx::Font->new( 24, # font size wxMODERN, # font family wxNORMAL, # style wxNORMAL, # weight 0, 'Verdana', # face name wxFONTENCODING_SYSTEM); my $grid = Wx::Grid->new($frame); $grid->SetLabelFont($font); $grid->CreateGrid( 5, # int numRows, 5, # int numCols, wxGridSelectCells # wxGridSelectionModes selmode = wxGridSelectCells ); #$grid->AutoSize(); # auto adjust width & height of all cells $grid->AutoSizeRowLabelSize($_) for( 0 .. $grid->GetNumberCols() ); # adjust height of rows 1-5 foreach my $x ( 0 .. $grid->GetNumberRows() ) { foreach my $y ( 0 .. $grid->GetNumberCols() ) { $grid->SetCellFont( $x, # int row, $y, # int col, $font # const wxFont & font ); } } $app->SetTopWindow($frame); # Fenster als oberstes bestimmen $frame->Show(1); # Fenster zeichnen 1; } 1; # /MyApp package main; use strict; use warnings; MyApp->new->MainLoop(); exit(0);