1
我目前在wxpython中有一个带有开始图标的工具栏。我想要它,所以当这个图标被点击时,它使用的图标和方法变化停止。使用wxPython更改工具栏中的标签
这是我到目前为止的代码:
#!/usr/bin/env python
# encoding: utf-8
"""
logClient2.py
Created by Allister on 2010-11-30.
"""
import wx
import sqlite3
WINDOW_SIZE = (900,400)
class logClient(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=WINDOW_SIZE)
self.toolbar = self.CreateToolBar()
self.toolbar.AddLabelTool(1, 'Refresh', wx.Bitmap('icons/refresh_icon.png'))
self.toolbar.Realize()
self.Bind(wx.EVT_TOOL, self.startLiveUpdate, id=1)
self.Show(True)
def startLiveUpdate(self, event):
pass
if __name__ == '__main__':
app = wx.App(False)
logClient(None, -1, "Log Event Viewer")
app.MainLoop()
不是真的一定要放什么startLiveUpdate方法?
感谢您的帮助!
但在有工具栏上更多的按钮的情况下,这一招不保留订单,并添加到最后..有什么建议? – DevC 2014-04-15 08:18:29