test.py 809 Bytes
Newer Older
1
import wx, os, math
Duane Johnson's avatar
Duane Johnson committed
2
from bufferedcanvas import *
3

4 5
from xybuttons import XYButtons
from zbuttons import ZButtons
6 7 8 9

class MyFrame(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(800, 600))
10
        sizer = wx.BoxSizer()
11
        self.xy = XYButtons(self, moveCallback=self.moveXY)
12
        sizer.Add(self.xy)
13
        self.z = ZButtons(self, moveCallback=self.moveZ)
14 15 16
        sizer.Add(self.z)

        self.SetSizer(sizer)
17 18 19 20 21 22
    
    def moveXY(self, x, y):
        print "got x", x, 'y', y
    
    def moveZ(self, z):
        print "got z", z
23 24 25 26 27 28 29 30 31 32 33


class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None, -1, 'test.py')
        frame.Show(True)
        frame.Centre()
        return True

app = MyApp(0)
app.MainLoop()