From da7f320dc609e744817c311652d82f5ae1113736 Mon Sep 17 00:00:00 2001 From: erick Date: Sat, 05 Dec 2009 20:42:38 +0000 Subject: First version of FrameProbe --- (limited to 'tutorius/editor.py') diff --git a/tutorius/editor.py b/tutorius/editor.py index 9d2effe..7f2cc8e 100644 --- a/tutorius/editor.py +++ b/tutorius/editor.py @@ -23,9 +23,11 @@ import gobject #import gconf from gettext import gettext as _ +from sugar.graphics.window import Window from .gtkutils import register_signals_numbered, get_children + class WidgetIdentifier(gtk.Window): """ Tool that allows identifying widgets. @@ -126,12 +128,26 @@ class WidgetIdentifier(gtk.Window): typecol = gtk.TreeViewColumn(_("Widget"), typerendr, text=1, background=1, foreground=1) explorer.append_column(typecol) - self.__populate_treestore( - tree, #tree - tree.append(None, ["0",self._activity.get_name()]), #parent - self._activity, #widget - "0" #path - ) + + if isinstance(self._activity, Window): + self.__populate_treestore( + tree, #tree + tree.append(None, ["0",str(self._activity)]), #parent + self._activity, #widget + "0" #path + ) + else: + # Assume it is the frame + for win in [self._activity._left_panel,\ + self._activity._right_panel,\ + self._activity._top_panel,\ + self._activity._bottom_panel]: + self.__populate_treestore( + tree, #tree + tree.append(None, ["0",str(self._activity)]), #parent + win, #widget + "0" #path + ) explorer.set_expander_column(typecol) @@ -158,13 +174,25 @@ class WidgetIdentifier(gtk.Window): typecol2 = gtk.TreeViewColumn(_("Widget"), typerendr2, text=1, background=1, foreground=1) explorer2.append_column(typecol2) - self.__populate_gobject_treestore( - tree2, #tree - tree2.append(None, ["activity",self._activity.get_name()]), #parent - self._activity, #widget - "activity" #path - ) - + if isinstance(self._activity, Window): + self.__populate_gobject_treestore( + tree2, #tree + tree2.append(None, ["activity",str(self._activity)]), #parent + self._activity, #widget + "activity" #path + ) + else: + # Assume it is the frame + for win in [self._activity._left_panel,\ + self._activity._right_panel,\ + self._activity._top_panel,\ + self._activity._bottom_panel]: + self.__populate_gobject_treestore( + tree2, #tree + tree2.append(None, ["activity",str(self._activity)]), #parent + win, #widget + "activity" #path + ) explorer2.set_expander_column(typecol2) swd3 = gtk.ScrolledWindow() -- cgit v0.9.1