Вот быстро взломанный вместе. Протестировано на Ubuntu 9.10, Python 2.6, wx 2.8.10.1
#!/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.startLiveUpdate(None)
self.Show(True)
def startLiveUpdate(self, event):
self.createToolbarItem("Refresh", "refresh.jpg", self.stopLiveUpdate)
def stopLiveUpdate(self, event):
self.createToolbarItem("Stop", "refresh2.jpg", self.startLiveUpdate)
def createToolbarItem(self, label, imageName, method):
self.toolbar.RemoveTool(1)
self.toolbar.AddLabelTool(1, label, wx.Bitmap(imageName))
self.toolbar.Realize()
self.Bind(wx.EVT_TOOL, method, id=1)
if __name__ == '__main__':
app = wx.App(False)
logClient(None, -1, "Log Event Viewer")
app.MainLoop()