作者pyLIC (PyLan)
看板Python
标题[问题] wxpython 改变wx.StaticText的值??
时间Fri Jul 23 16:13:16 2010
请问wx.StaticText的值可以变动吗??
写在我的frame底下
如下
self.totalLabel=wx.StaticText(self.panel,-1,"total: %d" % self.record.total)
在初始时self.record.total=0
若经过某个event後 这个total值逐渐增加改变
有没有办法直接用refresh之类的方式重新去设定这个StaticText显示的值
我试过
self.Refresh()
self.panel.Refresh()
self.totalLabel.Refresh()
都没有作用
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.47.133.56
1F:→ StubbornLin:self.totalLabel.Label = "xxx" 07/23 17:44
2F:推 hsnu114444:要用setValue() 07/23 18:21
3F:→ pyLIC:StaticText应该没有SetValue这个method TextCtrl才有 07/23 20:57
4F:→ pyLIC:不过是不是没有简单的方法 直接让self.record.total更新 07/23 20:58
5F:→ pyLIC:这样我用 string format的作用好像就变小了 07/23 20:59
6F:→ pyLIC:不过有SetLabel这个method 07/23 21:59