X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95bfd958bda8955ac81277c78e5627c926154f39..db679b8c836e69c111cdc31e62cf92cebe4f938f:/wxPython/demo/PyPlot.py?ds=inline diff --git a/wxPython/demo/PyPlot.py b/wxPython/demo/PyPlot.py index 954f37ec6e..f916dc6615 100644 --- a/wxPython/demo/PyPlot.py +++ b/wxPython/demo/PyPlot.py @@ -8,19 +8,33 @@ import wx.lib.plot # wx.lib.plot.py came with its own excellent demo built in, | # for testing purposes, but it serves quite well to demonstrate | # the code and classes within, so we are simply borrowing that | -# code for the demo. Please load up wx.py.plot.py for a review | +# code for the demo. Please load up wx.lib.plot.py for a review | # of the code itself. The demo/test is at the bottom of | # the file, as expected. | ################################################################/ -#---------------------------------------------------------------------- +#--------------------------------------------------------------------------- + +class TestPanel(wx.Panel): + def __init__(self, parent, log): + self.log = log + wx.Panel.__init__(self, parent, -1) + + b = wx.Button(self, -1, "Show the PyPlot sample", (50,50)) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) + + + def OnButton(self, evt): + win = wx.lib.plot.TestFrame(self, -1, "PlotCanvas Demo") + win.Show() + +#--------------------------------------------------------------------------- + def runTest(frame, nb, log): - # Loading the demo class directly from the library's - # test code. - win = wx.lib.plot.TestFrame(nb, -1, "PlotCanvas Demo") - frame.otherWin = win - return None + win = TestPanel(nb, log) + return win + #---------------------------------------------------------------------- @@ -49,22 +63,22 @@ come with the class itself. @@ -106,5 +120,5 @@ come with the class itself. if __name__ == '__main__': import sys,os import run - run.main(['', os.path.basename(sys.argv[0])]) + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])