rendered paste body#!/usr/bin/pythonimport wxclass MainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(800, 600)) self.panel = wx.Panel(self, -1) menubar = wx.MenuBar() file = wx.Menu() quit = wx.MenuItem(file, -1, '&Quit glPaint\tAlt+F4') file.AppendItem(quit) menubar.Append(file, '&File') self.SetMenuBar(menubar) self.brush_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/brush.png')) self.freehand_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/freehand.png')) self.eraser_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/eraser.png')) self.fill_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/fill.png')) self.rectangle_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/rectangle.png')) self.ellipse_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/ellipse.png')) self.polygon_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/polygon.png')) self.polyline_button = wx.BitmapButton(self.panel, -1, wx.Bitmap('icons/polyline.png')) self.glfield=wx.Panel(self, -1) self.glfield.SetBackgroundColour(wx.WHITE) self.Centre() self.Bind(wx.EVT_MENU, self.OnQuit, quit) self.layoutstuff() def layoutstuff(self): sizer = wx.BoxSizer(wx.VERTICAL) button_sizer = wx.GridSizer(rows=2) button_sizer.Add(self.eraser_button, -1) button_sizer.Add(self.brush_button, -1) button_sizer.Add(self.fill_button, -1) button_sizer.Add(self.freehand_button, -1) button_sizer.Add(self.rectangle_button, -1) button_sizer.Add(self.ellipse_button, -1) button_sizer.Add(self.polygon_button, -1) button_sizer.Add(self.polyline_button, -1) sizer.Add(self.glfield, 1, wx.EXPAND) sizer.Add(button_sizer,0, wx.BOTTOM) self.SetSizer(sizer) def OnQuit(self, event): self.Close(True) class glPaintApp(wx.App): def OnInit(self): frame = MainFrame(None, -1, 'glPaint') frame.Show(True) self.SetTopWindow(frame) return Trueapp = glPaintApp(0)app.MainLoop()