Wx::GridSizer

From WxPerl wiki

Jump to: navigation, search

Note that only the four-argument form of the constructor is available in WxPerl. The C++ API supports a three-argument form in which rows is omitted. Just pass in zero for rows in WxPerl.

Here's the example from layout.pl:

my( $gridsizer ) = Wx::GridSizer->new( 0, 2, 5, 5 );
$gridsizer->Add( Wx::StaticText->new( $this, -1, 'Label' ), 0,
                 wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL );
$gridsizer->Add( Wx::TextCtrl->new( $this, -1, 'Grid sizer demo' ), 1,
                 wxGROW|wxALIGN_CENTER_VERTICAL );
$gridsizer->Add( Wx::StaticText->new( $this, -1, 'Another label' ), 0,
                 wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL );
$gridsizer->Add( Wx::TextCtrl->new( $this, -1, 'More text' ), 0,
                 wxGROW|wxALIGN_CENTER_VERTICAL );
$gridsizer->Add( Wx::StaticText->new( $this, -1, 'Final label' ), 0,
                 wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL );
$gridsizer->Add( Wx::TextCtrl->new( $this, -1, 'And yet more text' ), 0,
                 wxGROW|wxALIGN_CENTER_VERTICAL );

Google AdSense