forked from UmSenhorQualquer/pyforms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControlBoundingSlider.py
More file actions
64 lines (38 loc) · 1.74 KB
/
Copy pathControlBoundingSlider.py
File metadata and controls
64 lines (38 loc) · 1.74 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "0.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
from __init__ import *
class SimpleExample(BaseWidget):
def __init__(self):
super(SimpleExample,self).__init__('Simple example')
#Definition of the forms fields
self._control = ControlBoundingSlider('Threshold', default=[80, 255], min=0, max=255,
horizontal=True, helptext='help text example')
self.formset = [' ','_control',' ']
# IO test
data = self._control.save_form({})
data['value'] = 200, 255
self._control.load_form(data)
self._control.hide()
self._control.show()
self._control.add_popup_menu_option('option 0', function_action=lambda x: x)
submenu1 = self._control.add_popup_submenu('menu 1')
submenu2 = self._control.add_popup_submenu('menu 2', submenu=submenu1)
self._control.add_popup_menu_option('option 1', function_action=lambda x: x, key='Control+Q', submenu=submenu2)
self._control.changed_event = self.__control_changed_event
self._control.value = [10,100]
#self._control.enabled = False
#self._control.label = 'Some label'
def __control_changed_event(self):
print self._control.value
##################################################################################################################
##################################################################################################################
##################################################################################################################
#Execute the application
if __name__ == "__main__": pyforms.start_app( SimpleExample )