Skip to content

Commit 9c974ef

Browse files
committed
Fixed some issues.
1 parent 24591b4 commit 9c974ef

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

examples/examples_from_contributors/SCOREBOARD_WITH_SETTING_PAGE/SCOREBOARD_WITH_SETTING_PAGE.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def idle(self):
2828
def ChangeColor(self, Text, Side, Num, BtUp, BtDn):
2929
self.In = 1
3030
with self.update_lock:
31-
Text.set_text(Num)
31+
Text.set_text(str(Num))
3232
Side.style['background-color'] = 'red'
3333
BtUp.attributes['class']='up80red'
3434
BtDn.attributes['class']='dn80red'
@@ -89,22 +89,22 @@ def main(self):
8989
self.wid3 = gui.Widget(width=230, height=350, margin='5px', style={'background':'green'})
9090
# Left side interface
9191
self.lblLeftName = gui.Label(self.Name1, width='95%', height='60px', style={'margin':'20px 2px 0px', 'font-size':'40px', 'line-height':'60px', 'text-align':'center', 'overflow':'hidden'})
92-
self.lblLeftNum = gui.Label(self.LeftNum, width='100%', height='130px', style={'margin':'0px 0px 10px', 'font-size':'140px', 'line-height':'130px', 'text-align':'center'})
92+
self.lblLeftNum = gui.Label(str(self.LeftNum), width='100%', height='130px', style={'margin':'0px 0px 10px', 'font-size':'140px', 'line-height':'130px', 'text-align':'center'})
9393
self.btLeftPlus = gui.Button('', width='80px', height='80px', style={'margin':'0px 10px 20px', 'font-size':'50px', 'line-height':'50px', 'text-align':'center'})
9494
self.btLeftPlus.attributes['class']='up80'
9595
self.btLeftMinus = gui.Button('', width='80px', height='80px', style={'margin':'0px 10px 20px', 'font-size':'50px', 'line-height':'50px', 'text-align':'center'})
9696
self.btLeftMinus.attributes['class']='dn80'
9797
lblLeftMatch = gui.Label('MATCHES WON:', width=150, height='30px', style={'margin':'0px 5px', 'font-size':'20px', 'line-height':'30px', 'text-align':'left', 'display':'inline'})
98-
self.lblLeftMatches = gui.Label(self.LeftMatchNum, width=30, height='30px', style={'margin':'0px 5px', 'font-size':'20px', 'line-height':'30px', 'text-align':'left', 'display':'inline'})
98+
self.lblLeftMatches = gui.Label(str(self.LeftMatchNum), width=30, height='30px', style={'margin':'0px 5px', 'font-size':'20px', 'line-height':'30px', 'text-align':'left', 'display':'inline'})
9999
# Right side interface
100100
self.lblRightName = gui.Label(self.Name2, width='95%', height='60px', style={'margin':'20px 2px 0px', 'font-size':'40px', 'line-height':'60px', 'text-align':'center', 'overflow':'hidden'})
101-
self.lblRightNum = gui.Label(self.LeftNum, width='100%', height='130px', style={'margin':'0px 0px 10px', 'font-size':'140px', 'line-height':'130px', 'text-align':'center'})
101+
self.lblRightNum = gui.Label(str(self.LeftNum), width='100%', height='130px', style={'margin':'0px 0px 10px', 'font-size':'140px', 'line-height':'130px', 'text-align':'center'})
102102
self.btRightPlus = gui.Button('', width='80px', height='80px', style={'margin':'0px 10px 20px', 'font-size':'50px', 'line-height':'50px', 'text-align':'center'})
103103
self.btRightPlus.attributes['class']='up80'
104104
self.btRightMinus = gui.Button('', width='80px', height='80px', style={'margin':'0px 10px 20px', 'font-size':'50px', 'line-height':'50px', 'text-align':'center'})
105105
self.btRightMinus.attributes['class']='dn80'
106106
lblRightMatch = gui.Label('MATCHES WON:', width=150, height='30px', style={'margin':'0px 5px', 'font-size':'20px', 'line-height':'30px', 'text-align':'left', 'display':'inline'})
107-
self.lblRightMatches = gui.Label(self.RightMatchNum, width=30, height='30px', style={'margin':'0px 5px', 'font-size':'20px', 'line-height':'30px', 'text-align':'left', 'display':'inline'})
107+
self.lblRightMatches = gui.Label(str(self.RightMatchNum), width=30, height='30px', style={'margin':'0px 5px', 'font-size':'20px', 'line-height':'30px', 'text-align':'left', 'display':'inline'})
108108
# Appends all the widgets to create the interface
109109
self.wid2.append([self.lblLeftName, self.lblLeftNum, self.btLeftPlus, self.btLeftMinus, lblLeftMatch, self.lblLeftMatches])
110110
self.wid3.append([self.lblRightName, self.lblRightNum, self.btRightPlus, self.btRightMinus, lblRightMatch, self.lblRightMatches])
@@ -113,7 +113,7 @@ def main(self):
113113
# Extra labels and button to manage:
114114
# The number of games to win, to win a match
115115
lblMatch = gui.Label('GAMES FOR MATCH:', width='50%', height='50px', style={'margin':'15px 2px 0px 10px', 'font-size':'25px', 'line-height':'35px', 'text-align':'center'})
116-
self.lblMatches = gui.Label(self.MatchNum, width='8%', height='50px', style={'margin':'15px 2px 0px', 'font-size':'25px', 'line-height':'35px', 'text-align':'center'})
116+
self.lblMatches = gui.Label(str(self.MatchNum), width='8%', height='50px', style={'margin':'15px 2px 0px', 'font-size':'25px', 'line-height':'35px', 'text-align':'center'})
117117
btMatchPlus = gui.Button('', width='50px', height='50px', style={'margin':'5px 2px 0px 20px', 'font-size':'30px', 'line-height':'30px', 'text-align':'center'})
118118
btMatchPlus.attributes['class']='up50'
119119
btMatchMinus = gui.Button('', width='50px', height='50px', style={'margin':'5px 2px', 'font-size':'30px', 'line-height':'30px', 'text-align':'center'})
@@ -185,11 +185,11 @@ def on_button_setting(self, emitter):
185185
def check_score(self):
186186
# Here the software update automatically any number you can see in the app
187187
if (self.LeftNum < self.MatchNum) and (self.RightNum < self.MatchNum):
188-
self.lblLeftNum.set_text(self.LeftNum)
189-
self.lblRightNum.set_text(self.RightNum)
190-
self.lblLeftMatches.set_text(self.LeftMatchNum)
191-
self.lblRightMatches.set_text(self.RightMatchNum)
192-
self.lblMatches.set_text(self.MatchNum)
188+
self.lblLeftNum.set_text(str(self.LeftNum))
189+
self.lblRightNum.set_text(str(self.RightNum))
190+
self.lblLeftMatches.set_text(str(self.LeftMatchNum))
191+
self.lblRightMatches.set_text(str(self.RightMatchNum))
192+
self.lblMatches.set_text(str(self.MatchNum))
193193
# Here the software check if a background needs to be green or orange.
194194
if (self.LeftNum < self.MatchNum - 1):
195195
self.wid2.style['background-color'] = 'green'

0 commit comments

Comments
 (0)