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