ocarina/ocarina/body/page.py

45 lines
933 B
Python

# Bryan Schumaker (4 / 17 / 2011)
import gtk
import header
import footer
SHRINK = gtk.SHRINK
GROW = gtk.FILL | gtk.EXPAND
class OcarinaPage(gtk.Table):
def __init__(self, content, label):
gtk.Table.__init__(self, 3, 1, False)
self.content = content
self.label = label
self.block_shortcuts = False
self.attach_center(content)
self.show()
def visible(self):
self.attach_top(header.header)
self.attach_bottom(footer.footer)
def invisible(self):
if header.header.get_parent() == self:
self.remove(header.header)
if footer.footer.get_parent() == self:
self.remove(footer.footer)
def attach_top(self, content):
self.attach(content, 0, 1, 0, 1, GROW, SHRINK)
def attach_center(self, content):
self.attach(content, 0, 1, 1, 2)
def attach_bottom(self, content):
self.attach(content, 0, 1, 2, 3, GROW, SHRINK)
def filter(self, text):
pass
def goto(self):
pass
def clear(self):
pass