1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| # -*- coding: iso-8859-1 -*-
import wx
import Log
class Principale(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, id=-1, parent = None, title = "fenêtre principale")
self.compteur = 0
self.bouton = wx.Button(self, -1, label = "Pressez-moi")
self.Bind(wx.EVT_BUTTON, self.BoutonPresse, self.bouton)
self.espion = Log.log()
self.espion.Show(True)
def BoutonPresse(self, evt):
self.compteur += 1
self.espion.SetValeur("Le bouton a été pressé " + str(self.compteur) + " fois" )
class MonApp(wx.App):
def OnInit(self):
fen =Principale()
fen.Show(True)
self.SetTopWindow(fen)
return True
app = MonApp()
app.MainLoop() |
Partager