forked from npcole/npyscreen
-
Notifications
You must be signed in to change notification settings - Fork 2
/
testingSliders.py
37 lines (27 loc) · 996 Bytes
/
testingSliders.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
import osc_npyscreen
import curses
class ScansSlider(osc_npyscreen.Slider):
def translate_value(self):
return "{:2d}".format(int(self.value))
class TitleScansSlider(osc_npyscreen.TitleSlider):
_entry_type = ScansSlider
#class ScanRunForm(osc_npyscreen.FormBaseNew):
# DEFAULT_LINES = 12
# DEFAULT_COLUMNS = 50
# SHOW_ATX = 5
# SHOW_ATY = 3
#
# def create(self):
# wLoc = self.add(osc_npyscreen.TitleText, name="Location:")
# wPasses = self.add(ScansSlider, name="Scans:", out_of=10,
# lowest=1, step=1)
def sliderTest(screen):
F = osc_npyscreen.Form()
F.add(osc_npyscreen.TitleSlider, name="Slider 1")
F.add(osc_npyscreen.TitleSlider, color='STANDOUT', name="Slider 2")
F.add(osc_npyscreen.Slider, name="Slider 3")
wPasses = F.add(TitleScansSlider, name="Scans:", out_of=10,
lowest=1, step=1)
F.edit()
if __name__ == "__main__":
curses.wrapper(sliderTest)