42 lines
846 B
Python
42 lines
846 B
Python
# Bryan Schumaker (11/24/2010)
|
|
|
|
import ocarina
|
|
gtk = ocarina.gtk
|
|
Label = gtk.Label
|
|
|
|
body = None
|
|
contents = dict()
|
|
|
|
class TabPage(gtk.VBox):
|
|
def __init__(self, content):
|
|
gtk.VBox.__init__(self)
|
|
self.content = content
|
|
#self.pack_start(content)
|
|
self.show()
|
|
|
|
def visible(self):
|
|
if hasattr(self.content, "visible"):
|
|
self.content.visible()
|
|
|
|
def invisible(self):
|
|
if hasattr(self.content, "invisible"):
|
|
self.content.invisible()
|
|
|
|
def init():
|
|
global body
|
|
body = gtk.Notebook()
|
|
body.set_tab_pos(gtk.POS_LEFT)
|
|
body.connect("switch-page", switch_page)
|
|
body.show()
|
|
|
|
def add_page(text, content):
|
|
label = Label(text)
|
|
label.set_angle(90)
|
|
page = TabPage(content)
|
|
contents[text] = page
|
|
body.append_page(page, label)
|
|
body.set_tab_label_packing(page, True, True, gtk.PACK_START)
|
|
|
|
def switch_page(notebook, page, pagenum):
|
|
pass
|