How can I create a widget without it being placed on its parent?
Here's a minimal example.
package MyApp;
use strict;
use warnings;
use Wx;
use base 'Wx::App';
sub OnInit {
my ($self) = @_;
my $frame
= Wx::Frame->new( undef, -1, 'Test', [ -1, -1 ], [ 250, 150 ], );
my $sizer = Wx::GridBagSizer->new( 0, 0 );
my $btn1 = Wx::Button->new( $frame, -1, '1' );
my $btn2 = Wx::Button->new( $frame, -1, '2' );
$sizer->Add( $btn1, Wx::GBPosition->new( 2, 2 ) );
$frame->SetSizer($sizer);
$frame->Show(1);
1;
}
package main;
MyApp->new->MainLoop;
This yields
I want only what is placed in the sizer (button 1) to show.