Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
The stupid question is the question not asked
 
PerlMonks  

Re: Wx::Panel not rendering

by tunaboy (Curate)
on Feb 10, 2005 at 00:06 UTC ( #429552=note: print w/ replies, xml ) Need Help??


in reply to Wx::Panel not rendering

OS: WinXP
Perl: ActiveState 5.8.3 build 809
wxPerl: 0.19

With your original code if I minimise then maximise the window the panel appears. So my guess is the window needs to be redrawn for the panel to appear. I tried doing a $self->Refresh inside the menu callback but that did not work for me.

I made the following changes to have it appear automatically:

... # when the "New" menu item is activated, a panel should render EVT_MENU($self, $ID_MAKE_PANEL, \&_make_panel ); EVT_MENU($self, $ID_EXIT, sub { $self->Close(1) }); $self; } sub _make_panel { my ( $self ) = @_; return if exists $self->{'panel'}; use Wx qw( wxVERTICAL wxGROW ); my $panel = Wx::Panel->new( $self, # parent -1, # id [ -1, -1 ], # position [ 200, 200 ] ); # size my $sizer = Wx::BoxSizer->new(wxVERTICAL); $sizer->Add( $panel, 1, wxGROW ); $self->SetSizer($sizer); $sizer->SetSizeHints($self); $self->{'panel'} = $panel; } ...

Using the sizer to resize the window after the panel is created makes it appear for me. Of course the frame changes size as well which may not be what you are after.

I am not sure if this is what you are after or if it helps at all.


Comment on Re: Wx::Panel not rendering
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://429552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2014-04-19 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (481 votes), past polls