ocarina/trunk/src/GuiObjects/button.py

22 lines
447 B
Python

import pygtk
pygtk.require('2.0')
import gtk
from image import Image
class Button(gtk.Button):
def __init__(self,name,image,text,func):
gtk.Button.__init__(self)
box = gtk.HBox(True,0)
if image!= None:
box.pack_start(image,True,True,0)
#box.add(image)
if text != None:
label = gtk.Label(text)
label.show()
box.pack_start(label,False,False,0)
box.show()
self.add(box)
self.connect("clicked",func,name)
self.show()