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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
# generated by wxGlade 0.6.3 on Sun Nov 09 18:56:53 2008
import wx
# begin wxGlade: extracode
# end wxGlade
class MyFrame1(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame1.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.panel_1 = wx.Panel(self, -1)
self.button_1 = wx.Button(self, -1, "Affichage")
self.button_2 = wx.Button(self, -1, "Refresh")
self.Bind(wx.EVT_BUTTON, self.on_click1, self.button_1)
self.Bind(wx.EVT_BUTTON, self.on_click2, self.button_2)
#wx.EVT_PAINT(self, self.on_Paint)
self.__set_properties()
self.__do_layout()
#wx.EVT_PAINT(self, self.on_Paint)
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyFrame1.__set_properties
self.SetTitle("frame_2")
self.panel_1.SetMinSize((392, 131))
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame1.__do_layout
grid_sizer_1 = wx.FlexGridSizer(3, 1, 0, 0)
grid_sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0)
grid_sizer_1.Add(self.button_1, 0, 0, 0)
grid_sizer_1.Add(self.button_2, 0, 0, 0)
self.SetSizer(grid_sizer_1)
grid_sizer_1.Fit(self)
self.Layout()
# end wxGlade
def on_click1(self, event): # wxGlade: MyFrame1.<event_handler>
print "on_click"
b=wx.Bitmap("base.bmp",wx.BITMAP_TYPE_BMP)
self.dc=wx.ClientDC(self.panel_1)
self.dc.DrawCircle(20,20,10)
#self.dc.DrawBitmap(b,0+i,0)
def on_click2(self, event): # wxGlade: MyFrame1.<event_handler>
self.panel_1.Refresh()
# end of class MyFrame1
if __name__ == "__main__":
app = wx.PySimpleApp(0)
wx.InitAllImageHandlers()
frame_2 = MyFrame1(None, -1, "")
app.SetTopWindow(frame_2)
frame_2.Show()
app.MainLoop() |