-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiceRollerV3.py
More file actions
53 lines (39 loc) · 1.5 KB
/
DiceRollerV3.py
File metadata and controls
53 lines (39 loc) · 1.5 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
from random import randint
import pyforms
from pyforms.basewidget import BaseWidget
from pyforms.controls import *
from pyforms.controls import ControlFile
from pyforms.controls import ControlText
from pyforms.controls import ControlSlider
from pyforms.controls import ControlPlayer
from pyforms.controls import ControlButton
from pyforms.controls import ControlLabel
results = ['','','']
class DiceRoller(BaseWidget):
def __init__(self):
super().__init__('DiceRoller')
#PYFORMS_STYLESHEET = 'style.css'
self._resultlabel = ControlLabel('Last 3 Results: ')
self._resultDisplay0 = ControlLabel()
self._resultDisplay1 = ControlLabel()
self._resultDisplay2 = ControlLabel()
self._1d4img = ControlImage('img\1d4a.jpg')
self._1d4 = ControlButton('1d4')
self._1d6 = ControlButton('1d6')
self._1d8 = ControlButton('1d8')
self._1d10 = ControlButton('1d10')
self._1d12 = ControlButton('1d12')
self._1d20 = ControlButton('1d20')
#Define the Button Actions
self._1d4.value = self._1d4Action
#Define the organization of the Form Controls
self._formset = [
'_1d4',
'_1d6',
'_1d8',
'_1d10',
'_1d12',
'_1d20',
('_resultlabel','_resultDisplay0','_resultDisplay1','_resultDisplay2')
]
if __name__ == '__main__': pyforms.start_app(DiceRoller)