File: layout_form.py

package info (click to toggle)
python-guizero 1.1.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,676 kB
  • sloc: python: 6,286; makefile: 28; sh: 17
file content (24 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from guizero import App, Text, TextBox, Combo, PushButton, Box

app = App()

Text(app, text="My form")

form = Box(app, width="fill", layout="grid")
form.border = True

Text(form, text="Title", grid=[0,0], align="right")
TextBox(form, grid=[1,0])

Text(form, text="Name", grid=[0,1], align="right")
TextBox(form, grid=[1,1])

Text(form, text="Age", grid=[0,2], align="right")
TextBox(form, grid=[1,2])

buttons = Box(app, width="fill", align="bottom")

PushButton(buttons, text="Ok", align="left")
PushButton(buttons, text="Cancel", align="left")

app.display()