Advertisement
metalx1000

Basic GTK Menu to start programs

Aug 19th, 2013
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import gtk, os
  4.  
  5. def press1(widget):
  6.     os.system("gimp&")
  7.  
  8. def press2(widget):
  9.     os.system("glxgears&")
  10.  
  11.  
  12. win=gtk.Window()
  13. win.connect('destroy', lambda w: gtk.main_quit())
  14.  
  15. box = gtk.VBox()
  16. win.add(box)
  17.  
  18. send=gtk.Button("gimp")
  19. send.connect("clicked", press1)
  20. box.pack_start(send)
  21.  
  22. send=gtk.Button("glxgears")
  23. send.connect("clicked", press2)
  24. box.pack_start(send)
  25.  
  26.  
  27. win.show_all()
  28.  
  29. gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement