Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/waxy/canvas.py
diff options
context:
space:
mode:
Diffstat (limited to 'pynxc/waxy/canvas.py')
-rw-r--r--pynxc/waxy/canvas.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/pynxc/waxy/canvas.py b/pynxc/waxy/canvas.py
new file mode 100644
index 0000000..072fb85
--- /dev/null
+++ b/pynxc/waxy/canvas.py
@@ -0,0 +1,33 @@
+# canvas.py
+
+import wx
+import waxyobject
+
+class Canvas(wx.ScrolledWindow, waxyobject.WaxyObject):
+
+ __events__ = {
+ 'Paint': wx.EVT_PAINT,
+ }
+
+ def __init__(self, parent):
+ wx.ScrolledWindow.__init__(self, parent, wx.NewId())
+ self.Init()
+
+ self.BindEvents()
+
+ def _OnPaint(self, event=None):
+ self.OnPaint(event)
+ def OnPaint(self, event=None):
+ dc = wx.PaintDC(self)
+ self.PrepareDC(dc)
+ self.OnDraw(dc)
+ event.Skip()
+
+ def OnDraw(self, dc):
+ # override to draw on the canvas
+ pass
+
+ def Init(self):
+ # override to place scrollbars, set color, etc.
+ pass
+