forked from npcole/npyscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tokentextbox.py
executable file
·52 lines (44 loc) · 1.3 KB
/
tokentextbox.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
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: npsapp.py
import cProfile
import pstats
from npyscreen import NPSApp
from npyscreen import Form
from npyscreen import TextTokens, TitleTextTokens
class TextBoxForm(Form):
def create(self):
tb = self.add(TextTokens, name="TokenField", )#max_width=25)
tb.value = [
"Token 1 Testing",
"Token 2 ééé",
"Token 3 ",
"Token 4 ",
"Token 6 ",
"Token 7 ",
"Token 8 ",
"Token 9 ",
"Token 10 ",
"Token 11 ",
"Token 12 ",
"Token 6b ",
"Token 7b ",
"Token 8b ",
"Token 9b ",
"Token 10b ",
"Token 11b ",
"Token 12b ",
]
#tb.begin_at += 0
#tb.important=True
#tb.show_bold=True
self.highlight=True
tb.cursor_position=3
tb.left_margin=8
class App(NPSApp):
def main(self):
form = TextBoxForm(name='Welcome to Npyscreen')
form.edit()
if __name__ == '__main__':
app = App()
p = cProfile.run('app.run()', sort=1)