def createButton(parent, text="", stock=None, name="", gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None):
"""Creates a button widget and adds it to a parent widget."""
if stock:
temp = gtk.Button(text, stock)
else:
temp = gtk.Button(text)
temp.set_name(name)
temp.connect("clicked", handler)
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
return temp
评论列表
文章目录