Te recomiendo leer
wxpython in action, te ayudara a ententer todo lo que necesitas sobre wx.
Código Python:
Ver original#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.4 on Wed Dec 19 11:21:44 2012
import wx
# begin wxGlade: extracode
# end wxGlade
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.panel_1 = wx.Panel(self, -1)
self.static_box_1 = wx.StaticBox(self.panel_1, -1, "PANEL DE LA HERRAMIENTA 1 - UNO")
self.panel_2 = wx.Panel(self, -1)
self.static_box_2 = wx.StaticBox(self.panel_2, -1, "PANEL DE LA HERRAMIENTA 2 - DOS")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_TOOL, self.OnClickHerramienta1, self.button_Herramienta1)
self.Bind(wx.EVT_TOOL, self.OnClickHerramienta2, self.button_Herramienta2)
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
self.SetSize((300, 300))
self.panel_2.Hide()
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
# Tool Bar
self.frame_1_toolbar = wx.ToolBar(self, -1)
self.SetToolBar(self.frame_1_toolbar)
self.button_Herramienta1 = self.frame_1_toolbar.AddLabelTool(1, "HERRAMIENTA1", wx.Bitmap("1.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Herramienta1", "Herramienta1")
self.button_Herramienta2 = self.frame_1_toolbar.AddLabelTool(2, "HERRAMIENTA2", wx.Bitmap("2.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Herramienta2", "Herramienta2")
# Tool Bar end
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_3 = wx.BoxSizer(wx.VERTICAL)
sizer_2 = wx.BoxSizer(wx.VERTICAL)
sizer_2.Add(self.static_box_1, 0, 0, 0)
self.panel_1.SetSizer(sizer_2)
sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0)
sizer_3.Add(self.static_box_2, 0, 0, 0)
self.panel_2.SetSizer(sizer_3)
sizer_1.Add(self.panel_2, 1, wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
def OnClickHerramienta1(self, event):
self.panel_1.Hide()
self.panel_2.Show()
self.Layout()
event.Skip()
def OnClickHerramienta2(self, event):
self.panel_2.Hide()
self.panel_1.Show()
self.Layout()
event.Skip()
# end of class MyFrame
if __name__ == "__main__":
app = wx.PySimpleApp(0)
wx.InitAllImageHandlers()
frame_1 = MyFrame(None, -1, "")
app.SetTopWindow(frame_1)
frame_1.Show()
app.MainLoop()