@@ -251,27 +251,19 @@ def set_text(self, val, index=0):
251
251
if self ._text_maxlen [index ]:
252
252
string = string [: self ._text_maxlen [index ]]
253
253
print ("text index" , self ._text [index ])
254
+ index_in_splash = None
254
255
if self ._text [index ] is not None :
255
256
print ("Replacing text area with :" , string )
256
257
self ._text [index ].text = string
257
- text_index = self .splash .index (self ._text [index ])
258
-
259
- self ._text [index ] = Label (
260
- self ._text_font , text = string , max_glyphs = max_glyphs
261
- )
262
- self ._text [index ].color = self ._text_color [index ]
263
- self ._text [index ].x = self ._text_position [index ][0 ]
264
- self ._text [index ].y = self ._text_position [index ][1 ]
265
- self .splash [text_index ] = self ._text [index ]
266
-
267
- elif self ._text_position [index ]: # if we want it placed somewhere...
268
- print ("Making text area with string:" , string )
269
- self ._text [index ] = Label (
270
- self ._text_font , text = string , max_glyphs = max_glyphs
271
- )
272
- self ._text [index ].color = self ._text_color [index ]
273
- self ._text [index ].x = self ._text_position [index ][0 ]
274
- self ._text [index ].y = self ._text_position [index ][1 ]
258
+ index_in_splash = self .splash .index (self ._text [index ])
259
+ self ._text [index ] = Label (self ._text_font , text = string , max_glyphs = max_glyphs )
260
+ self ._text [index ].color = self ._text_color [index ]
261
+ self ._text [index ].x = self ._text_position [index ][0 ]
262
+ self ._text [index ].y = self ._text_position [index ][1 ]
263
+
264
+ if index_in_splash is not None :
265
+ self .splash [index_in_splash ] = self ._text [index ]
266
+ else :
275
267
self .splash .append (self ._text [index ])
276
268
277
269
def get_local_time (self , location = None ):
0 commit comments