ocarina/ocarina/body/button.py
Bryan Schumaker 6385c1f342 Ocarina: Begin rewriting header
I show the entry, and I call a filter function for the current page.
2011-05-01 12:05:59 -04:00

34 lines
570 B
Python

# Bryan Schumaker (2 / 20 / 2011)
import gtk
SIZE = gtk.ICON_SIZE_MENU
def on_click(button, func):
func()
def stock_image(stock_item):
img = gtk.image_new_from_stock(stock_item, SIZE)
img.show()
return img
def make_text(text):
lbl = gtk.Label(text)
lbl.show()
return lbl
def default_button(func, show):
b = gtk.Button()
b.set_relief(gtk.RELIEF_NONE)
b.connect("clicked", on_click, func)
if show == True:
b.show()
return b
def make_button(stock_item, func, show):
b = default_button(func, show)
img = stock_image(stock_item)
b.add(img)
return b