forked from UmSenhorQualquer/pyforms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample3.py
More file actions
53 lines (37 loc) · 1.77 KB
/
Copy pathExample3.py
File metadata and controls
53 lines (37 loc) · 1.77 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
#!/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 *
import numpy as np
class Example3(BaseWidget):
def __init__(self):
super(Example3,self).__init__('Simple example 1')
#Definition of the forms fields
self._combobox = ControlCombo('Choose a item')
self._list = ControlList('List label')
self._progress = ControlProgress('Progress bar')
self._visvisVolume = ControlVisVisVolume('Visvis')
self._timeline = ControlEventTimeline('Timeline')
self.formset = [ ('_combobox',' '), '_progress', '=',('_visvisVolume', '||','_list'), '_timeline']
self._combobox.addItem('Item 1', 'Value 1')
self._combobox.addItem('Item 2', 'Value 2')
self._combobox.addItem('Item 3', 'Value 3')
self._combobox.addItem('Item 4') #The value is = to the item
self._list.value = [ ('Item1', 'Item2', 'Item3',), ('Item3', 'Item4', 'Item5',)]
#Create a an example of an image with volume
imageWithVolume = np.zeros( (100,100,100), np.uint8 )
imageWithVolume[30:40, 30:50, :] = 255
imageWithVolume[30:40, 70:72, :] = 255
#############################################
self._visvisVolume.value = imageWithVolume
##################################################################################################################
##################################################################################################################
##################################################################################################################
#Execute the application
if __name__ == "__main__": pyforms.start_app( Example3 )