Commits

Henning Schröder committed 5b05178

added test for gridlayout

  • Participants
  • Parent commits 133169c

Comments (0)

Files changed (1)

File test_gridlayout.py

+from tcore import TSize
+from tgui import TWidget, TPushButton, TApplication
+from tgui.layout import TGridLayout
+
+
+app = TApplication()
+container = TWidget(Pos=(10, 10), Size=(40, 20), WindowTitle="Tools")
+gl = TGridLayout()
+gl.GridSize = TSize(3,3)
+gl.Spacing = 1
+container.setLayout(gl)
+
+for row in range(gl.gridSize().height):
+    for col in range(gl.gridSize().width):
+        b = TPushButton(container, Text="%s/%s" % (row, col))
+        gl.addWidget(row, col, b)
+
+app.run()