#!/usr/bin/env python

import gtk

class Demo(gtk.Window):
    def __init__(self):
        gtk.Window.__init__(self)
        self.connect('destroy', lambda *w: gtk.main_quit())

        book = gtk.Notebook()
        self.add(book)

        book.set_show_tabs(False)

        button = gtk.Button('Click me to show the tabs!')
        button.connect('clicked', lambda w, b: b.set_show_tabs(True), book)
        book.append_page(button, gtk.Label('First'))

        self.show_all()
    def run (self):
        gtk.main()

if __name__ == '__main__':
    Demo().run()

