forked from npcole/npyscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TESTING-FormActiveV2.py
executable file
·40 lines (31 loc) · 1.32 KB
/
TESTING-FormActiveV2.py
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
#!/usr/bin/env python
# encoding: utf-8
import npyscreen
import curses
#npyscreen.disableColor()
class TestApp(npyscreen.NPSApp):
def main(self):
#self.test_memory_use()
self.test()
def test(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
F = npyscreen.ActionFormV2WithMenus(name = "Welcome to Npyscreen",)
ms = F.add(npyscreen.MultiLineActionWithShortcuts, max_height=4, value = [1,], name="Pick One",
values = ["Option1","Option2","Option3"], scroll_exit=True)
root = F.new_menu()
root.addItem('test', curses.beep)
# This lets the user play with the Form.
F.edit()
def test_memory_use(self):
n = 0
while 1:
F = npyscreen.fmActionFormV2.ActionFormV2(name = "Welcome to Npyscreen %s" % n)
#F = npyscreen.ActionForm(name = "Welcome to Npyscreen %s" % n)
ms = F.add(npyscreen.MultiLineActionWithShortcuts, max_height=4, value = [1,], name="Pick One",
values = ["Option1","Option2","Option3"], scroll_exit=True)
F.display()
n +=1
if __name__ == "__main__":
App = TestApp()
App.run()