#!/usr/bin/env python

import wx

class DemoApp(wx.App):

   def OnInit(self):
      frame = DemoFrame(parent=None, id=-1, title='DeveloperWorks')
      frame.Show()
      return True

class DemoFrame(wx.Frame):

   def __init__(self, parent, id, title):
      wx.Frame.__init__(self, parent, id, title)
      sizer = wx.BoxSizer(wx.VERTICAL)
      self.SetSizer(sizer)
      button = wx.Button(self, wx.ID_CLOSE, "Click Me")
      sizer.Add((50, 50))
      sizer.Add(button, 0, wx.ALL, 50)
      self.Bind(wx.EVT_BUTTON, self.OnButtonClick)

   def OnButtonClick(self, event):
      self.Close(True)

if __name__ == "__main__":
   app = DemoApp()
   app.MainLoop()
