Advertisement
Guest User

Untitled

a guest
Oct 15th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. from gi.repository import Gtk
  2.  
  3. win = Gtk.Window()
  4. win.connect('destroy', Gtk.main_quit)
  5.  
  6. grid = Gtk.Grid()
  7.  
  8. entry1 = Gtk.Entry()
  9. entry2 = Gtk.Entry()
  10.  
  11. button1 = Gtk.Button('Button1')
  12. button2 = Gtk.Button('Button2')
  13. button3 = Gtk.Button('Button3')
  14. button4 = Gtk.Button('Button4')
  15.  
  16. buttons_vbox = Gtk.VBox()
  17. buttons_vbox.set_spacing(10)
  18. buttons_vbox.set_margin_top(5)
  19.  
  20. #buttons_vbox.pack_start(button1, 0, 0, 0)
  21. #buttons_vbox.pack_start(button2, 0, 0, 0)
  22. buttons_vbox.pack_start(button3, 0, 0, 0)
  23. buttons_vbox.pack_start(button4, 0, 0, 0)
  24.  
  25. sw_child = Gtk.Table()
  26. sw_child.set_size_request(300, 300)
  27.  
  28. sw = Gtk.ScrolledWindow()
  29. sw.add(sw_child)
  30. sw.set_vexpand(True)
  31.  
  32. grid.set_column_spacing(10)
  33. grid.set_row_spacing(10)
  34.  
  35. grid.set_margin_top(10)
  36. grid.set_margin_left(10)
  37. grid.set_margin_right(10)
  38. grid.set_margin_bottom(10)
  39.  
  40. grid.attach(entry1, 0, 0, 1, 1)
  41. grid.attach(entry2, 0, 1, 1, 1)
  42.  
  43. grid.attach(sw, 0, 2, 1, 3)
  44.  
  45. grid.attach(button1, 1, 0, 1, 1)
  46. grid.attach(button2, 1, 1, 1, 1)
  47. grid.attach(buttons_vbox, 1, 2, 1, 1)
  48.  
  49. win.add(grid)
  50.  
  51. win.show_all()
  52.  
  53. Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement