Alex Fenton
6/17/2005 2:32:00 AM
Marcelo Paniagua wrote:
> I'm using WxRuby::Notebook, and after searching thought the ruby
> documents and Widgets documents, can't find anything to hide the page
> tab.
Wx::Notebook#remove_page might do what you want. The tab is removed
but the child windows within the tab aren't destroyed and can be re-shown
again later
a
__
require 'wxruby'
class BasicApp < Wx::App
def on_init
@frame = Wx::Frame.new( nil , -1 , "Basic Application" )
@notebook = Wx::Notebook.new( @frame, -1)
p1 = Wx::Panel.new( @frame, -1 )
@notebook.add_page(p1, 'foo')
p2 = Wx::Panel.new( @frame, -1 )
@notebook.add_page(p2, 'bar')
# hide
@notebook.remove_page(0)
# show again
@notebook.add_page(p1, 'foo anew')
@frame.show()
end
end
BasicApp.new().main_loop()