Well, what i’m trying to do is, through a menu, to change panels.
The problem is that i can’t find a way to change the panel, or refresh
or delete, or whatever should be done.
i’ve attached the the zip file with the runable code
the code is:
##on ‘def initialize’ of a Wx::Frame class
#@Panel=Panel.new(self)##If i initialize @panel here, it doesn’t refresh
when the event is called
###end initialize
###event functions##
def cState(menu)##the function called from the event
#@panel.destroy ## Error: undefined method `destroy’ for
nil:NilClass (NoMethodError)
@panel=Test.new(self)##a WX::Panel class.
end
##the other function is similar to this one
###end event functions
if i’m doing the wrong way, please tellme, and if possible, post a link
to an example, tutorial or explanation. I’d be very thankful
Well, what i’m trying to do is, through a menu, to change panels.
The problem is that i can’t find a way to change the panel, or refresh
or delete, or whatever should be done.
First off, have a look at whether a Wx::Notebook might suit your
requirements. It’s intended for combining different panels. It has
methods for switching easily between pages.
If you want to swap panels, you probably just need to destroy the old
panel and add in the new (see below)
I’m more used to doing this within a sizer-based layout, when it goes
something like: