Ali Afshar avatar Ali Afshar committed b13cd14

some debugging tools

Comments (0)

Files changed (3)

Add a comment to this file

gtkarchitect/utils/__init__.py

Empty file added.

gtkarchitect/utils/debug.py

+
+import gtk
+
+from lxml.etree import tostring
+
+from ..view.base import Slave
+
+class DebugSlave(Slave):
+
+
+    def create_ui(self):
+        t = self.get_toplevel()
+        buttons = gtk.HBox()
+        t.pack_start(buttons, expand=False)
+
+        self.dump_button = gtk.Button('Dump')
+        buttons.pack_start(self.dump_button, expand=False)
+
+    def set_main(self, mainview):
+        self.main = mainview
+
+    def on_dump_button__clicked(self, button):
+        p = self.main.project
+        print p
+        print tostring(p.tree)
+

gtkarchitect/view/main.py

         workspace = Workspace()
         projecttree = ProjectTree()
 
+        vb = gtk.VBox()
+        self.get_toplevel().add(vb)
+
         p = gtk.HPaned()
-        self.get_toplevel().add(p)
+        vb.pack_start(p)
         p.pack1(palette.get_toplevel())
         p2 = gtk.HPaned()
         p.pack2(p2)
         self.palette = palette
         self.workspace = workspace
         self.projecttree = projecttree
-        p.show_all()
+
+        from ..utils.debug import DebugSlave
+        self.debug = DebugSlave()
+        self.debug.set_main(self)
+        vb.pack_start(self.debug.get_toplevel())
+
+        vb.show_all()
 
     def on_palette__entity_selected(self, palette, entity_def):
         if entity_def is not None:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.