Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import gtk
- def img_click(self, widget):
- print "You Clicked an Image"
- win = gtk.Window()
- box = gtk.VBox()
- win.add(box)
- event_box = gtk.EventBox()
- event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK)
- event_box.connect("button_press_event", img_click)
- box.pack_start(event_box)
- img=gtk.Image()
- img.set_from_file("1.png")
- event_box.add(img)
- win.show_all()
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement