()
This test opens the MonitorFrame, as well as a frame
    with a show and hide button
This test opens the MonitorFrame, as well as a frame
    with a show and hide button
This test opens the MonitorFrame as well as a frame with a show and hide button
def test():
    """This test opens the MonitorFrame, as well as a frame
    with a show and hide button
    """

    class showFrame(wx.Frame):
        def __init__(self, parent):
            wx.Frame.__init__(self, parent, title="Monitor Toggle")
            sbtn = wx.Button(self, label="Show Frame")
            sbtn.Bind(wx.EVT_BUTTON, self.SendShowMsg)
            hbtn = wx.Button(self, label="Hide Frame")
            hbtn.Bind(wx.EVT_BUTTON, self.SendHideMsg)

            s = wx.BoxSizer(wx.VERTICAL)
            s.Add(sbtn, 0, wx.EXPAND)
            s.Add(hbtn, 0, wx.EXPAND)
            self.SetSizerAndFit(s)
            self.Layout()

        def SendShowMsg(self, evt):
            print
            "pressed show button"
            pub.sendMessage('monitor.show', show=True)

        def SendHideMsg(self, evt):
            print
            "pressed hide button"
            pub.sendMessage('monitor.hide')

    class myApp(wx.App, MonitorMixin):
        def OnInit(self):
            print
            "Making App"
            MonitorMixin.Init(self)
            show = showFrame(None)
            self.SetTopWindow(show)
            show.Show()
            show.Raise()
            print
            "OnInit end"
            return True

    a = myApp(False)
    print
    "Made app. Starting Mainloop"
    a.MainLoop()
    print
    "Done with main loop"
    a.Destroy()
    pub.delTopic('test')
def test ( ) : class showFrame ( wx . Frame ) : def __init__ ( self , parent ) : wx . Frame . __init__ ( self , parent , title = "Monitor Toggle" ) sbtn = wx . Button ( self , label = "Show Frame" ) sbtn . Bind ( wx . EVT_BUTTON , self . SendShowMsg ) hbtn = wx . Button ( self , label = "Hide Frame" ) hbtn . Bind ( wx . EVT_BUTTON , self . SendHideMsg ) s = wx . BoxSizer ( wx . VERTICAL ) s . Add ( sbtn , 0 , wx . EXPAND ) s . Add ( hbtn , 0 , wx . EXPAND ) self . SetSizerAndFit ( s ) self . Layout ( ) def SendShowMsg ( self , evt ) : print "pressed show button" pub . sendMessage ( 'monitor.show' , show = True ) def SendHideMsg ( self , evt ) : print "pressed hide button" pub . sendMessage ( 'monitor.hide' ) class myApp ( wx . App , MonitorMixin ) : def OnInit ( self ) : print "Making App" MonitorMixin . Init ( self ) show = showFrame ( None ) self . SetTopWindow ( show ) show . Show ( ) show . Raise ( ) print "OnInit end" return True a = myApp ( False ) print "Made app. Starting Mainloop" a . MainLoop ( ) print "Done with main loop" a . Destroy ( ) pub . delTopic ( 'test' )