[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Using WxRuby :: Notebook

Marcelo (PC)

6/16/2005 3:57:00 PM

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

--
Este correo esta libre de virus!



1 Answer

Alex Fenton

6/17/2005 2:32:00 AM

0

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()