I am trying to read a value in a variable from a different class every time I click on a refresh button for my GUI program. The problem is I am using statictext so when I refresh, it displays the new value on top of the old one.
In my main GUI: def refresh(self, event): x = refresh_var() value = wx.StaticText(self, -1, str(x.var_rate)) In my refresh class: class refresh_var(): def var_rate(self): random_var = random.randint(5, 100) return random_var So each time I click on the button, which runs refresh, the new value generated by random.randint will be on top of the old number. Is there any commands I can use to remove the old value that is on the GUI window before I put the new one on there? Or is there a better command/syntax that does the same job? I am ultimately trying to make it so the GUI program refreshes and rereads random_var on a set interval. Can anyone offer any advice on how to do it or any commands I can read up on the Internet?
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor