GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Source-Code-from-Tutorials/PythonGTK/Examples/05_grid.py at master · mycluster/Source-Code-from-Tutorials Expand file tree/ Copy path05_grid.pyMore file actions 46 lines (37 loc) · 1.3 KB / Copy path05_grid.pyFile metadata and controls46 lines (37 loc) · 1.3 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 from gi.repository import Gtk class GridWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Grid Example") grid = Gtk.Grid() self.add(grid) # create some buttons button1 = Gtk.Button(label="Button 1") button2 = Gtk.Button(label="Button 2") button3 = Gtk.Button(label="Button 3") button4 = Gtk.Button(label="Button 4") button5 = Gtk.Button(label="Button 5") button6 = Gtk.Button(label="Button 6") grid.add(button1) """ button to add column to attach the left side of button to row to attach the top side of button to column span (width) row span (height) """ grid.attach(button2, 1, 0, 2, 1) """ button to add item it should be placed next to where it should be displayed (in reference to the last param) column span row span """ grid.attach_next_to(button3, button1, Gtk.PositionType.BOTTOM, 1, 2) grid.attach_next_to(button4, button3, Gtk.PositionType.RIGHT, 2, 1) grid.attach(button5, 1, 2, 1, 1) grid.attach_next_to(button6, button5, Gtk.PositionType.RIGHT, 1, 1) win = GridWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |