Using WxRuby :: Notebook

M

Marcelo Paniagua

I'm using WxRuby::Notebook, and after searching thought the ruby
documents and Widgets documents, can't find anything to hide the page
tab. Is there a
method or property to do this?

Thanks
Marcelo
 
A

Alex Fenton

Marcelo said:
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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top