diff options
author | erick <erick@sugar-dev-erick.(none)> | 2009-12-05 20:42:38 (GMT) |
---|---|---|
committer | erick <erick@sugar-dev-erick.(none)> | 2009-12-06 05:19:24 (GMT) |
commit | 71c8003735f6d34dce6058b90b460f8b3a42d8bc (patch) | |
tree | b0ef89133643e2c8efc8a4aa97e112e3f4e44e5e /tutorius/editor.py | |
parent | 477d2dda1edc8fcbee00db63f7c4fc36225fdcae (diff) |
First version of FrameProbe
Diffstat (limited to 'tutorius/editor.py')
-rw-r--r-- | tutorius/editor.py | 54 |
1 files changed, 41 insertions, 13 deletions
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() |