hooke.ui.gui was getting complicated, so I stripped it down for a moment.
[hooke.git] / hooke / ui / gui / panel / commands.py
index 1d8313ae1812bb694e9f227d3c9c092910bf5678..84084090993c4242fff129c69b1f67beaf47d0e6 100644 (file)
@@ -16,6 +16,7 @@ import types
 import wx\r
 \r
 from ....util.callback import callback, in_callback\r
+from . import Panel\r
 \r
 \r
 class Tree (wx.TreeCtrl):\r
@@ -136,13 +137,14 @@ class Tree (wx.TreeCtrl):
                 in_callback(self, command, args)\r
 \r
 \r
-class Commands (wx.Panel):\r
+class CommandsPanel (Panel, wx.Panel):\r
     """\r
 \r
     `callbacks` is shared with the underlying :class:`Tree`.\r
     """\r
-    def __init__(self, commands, selected, callbacks, *args, **kwargs):\r
-        super(Commands, self).__init__(*args, **kwargs)\r
+    def __init__(self, callbacks=None, commands=None, selected=None, **kwargs):\r
+        super(CommandsPanel, self).__init__(\r
+            name='commands', callbacks=callbacks, **kwargs)\r
         self._c = {\r
             'tree': Tree(\r
                 commands=commands,\r
@@ -155,8 +157,8 @@ class Commands (wx.Panel):
             'execute': wx.Button(self, label='Execute'),\r
             }\r
         sizer = wx.BoxSizer(wx.VERTICAL)\r
-        sizer.Add(self._c['execute'], 0, wx.EXPAND)\r
         sizer.Add(self._c['tree'], 1, wx.EXPAND)\r
+        sizer.Add(self._c['execute'], 0, wx.EXPAND)\r
         self.SetSizer(sizer)\r
         sizer.Fit(self)\r
 \r