File: peanuts.py

package info (click to toggle)
newt 0.21-8
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 296 kB
  • ctags: 753
  • sloc: ansic: 4,813; python: 312; makefile: 179; sh: 2
file content (28 lines) | stat: -rwxr-xr-x 610 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/python

from snack import *

screen = SnackScreen()

li = Listbox(height = 3, width = 20, returnExit = 1)
li.append("First", 1)
li.append("Second", 2)
li.append("Third", 3)
rb = RadioBar(screen, (("This", "this", 0),
			("Default", "default", 1),
			("That", "that", 0)))
bb = ButtonBar(screen, (("Ok", "ok"), ("Cancel", "cancel")))

g = GridForm(screen, "My Test", 1, 3)
g.add(li, 0, 0)
g.add(rb, 0, 1, (0, 1, 0, 1))
g.add(bb, 0, 2, growx = 1)

result = g.run_once()

screen.finish()

print result
print "listbox:", li.current()
print "rb:", rb.getSelection()
print "bb:", bb.buttonPressed(result)