Argument-less command execution in GUI working!
authorW. Trevor King <wking@drexel.edu>
Thu, 29 Jul 2010 11:55:34 +0000 (07:55 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 29 Jul 2010 11:55:34 +0000 (07:55 -0400)
hooke/ui/gui/__init__.py
hooke/ui/gui/panel/commands.py

index dc21ebfbb9c814224b52c834c0ceb096b52e8114..d9706f2a1a3d3391daec8ee7d312f18e111638c5 100644 (file)
@@ -155,7 +155,6 @@ class HookeFrame (wx.Frame):
 #                    size=wx.Size(150, 90),\r
 #                    style=wx.NO_BORDER|wx.TE_MULTILINE), 'right'),\r
             ('output', panel.PANELS['output'](\r
-                    buffer_lines=5,\r
                     parent=self,\r
                     pos=wx.Point(0, 0),\r
                     size=wx.Size(150, 90),\r
@@ -655,6 +654,7 @@ class HookeFrame (wx.Frame):
     # Command panel interface\r
 \r
     def select_command(self, _class, method, command):\r
+        return\r
         self.select_plugin(plugin=command.plugin)\r
         plugin = self.GetItemText(selected_item)\r
         if plugin != 'core':\r
index 84084090993c4242fff129c69b1f67beaf47d0e6..b8bae8d0eb3889ed4c00a5e81eb6555e62d4f555 100644 (file)
@@ -129,12 +129,12 @@ class Tree (wx.TreeCtrl):
         in_callback(self, command)\r
 \r
     def execute(self):\r
-        item = self.GetSelection()\r
-        if item.IsOk():\r
-            if not self.ItemHasChildren(item):\r
-                item_text = self.GetItemText(item)\r
-                # TODO: generate args\r
-                in_callback(self, command, args)\r
+        _id = self.GetSelection()\r
+        name = self._name_for_id[self._canonical_id(_id)]\r
+        if self._is_command(name):\r
+            command = self._commands[name]\r
+            args = {}  # TODO: generate args\r
+            in_callback(self, command, args)\r
 \r
 \r
 class CommandsPanel (Panel, wx.Panel):\r