# -*- coding: utf-8 -*-
# Chapter 1: wxPython starting points
# Recipe 5: Understanding the window hierarchy
#
import wx
class MyPanel(wx.Panel):
def __init__(self, parent):
super(MyPanel, self).__init__(parent)
self.button = wx.Button(self, label="Push Me")
class MyFrame(wx.Frame):
def __init__(self, parent, title=""):
super(MyFrame, self).__init__(parent, title=title)
self.panel = MyPanel(self)
class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, title="Window Hierarchy")
self.frame.Show();
return True
if __name__ == "__main__":
app = MyApp(False)
app.MainLoop()