i just picked up gtk GUI programming. I was following the tutorial on Buttons.. and did the example code.
class Buttons:
def callback(self,widget,data=""> print "Hello again - %s was press" %data
def delete_event(self,widget,event,data=""> gtk.main_quit()
return False
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title ("Image buttons")
self.window.connect("delete_event",self.delete_event)
self.window.connect("destroy", self.delete_event)
self.window.set_border_width(20)
button = gtk.Button()
button.connect("clicked",self.callback,"cool button")
box1 = xpm_label_box(self.window,"info.xpm","cool button")
button.add(box1)
## add "quit" button
quitbox = gtk.HBox(False,0)
quitbutton = gtk.Button("quit")
quitbutton.connect("clicked",lambda w: gtk.main_quit())
quitbox.pack_start(quitbutton,1,1,2)
self.window.add(button)
#self.window.add(quitbox)
box1.show()
button.show ()
quitbox.show()
self.window.show()
def main(self):
gtk.main()
return 0
if __name__ == "__main__":
a = Buttons()
a.main()
Its suppose to show a button with an image inside. I wanted to add a "quit" button after the button with image, but the "quit" button
did not show up...which part of my code is wrong? thanks
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
