Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Rodríguez <ignaciorodriguez@sugarlabs.org>2013-05-11 16:21:38 (GMT)
committer Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org>2013-05-11 16:21:38 (GMT)
commit4b859ed3f61657a6eba7cadfa20a9c3173741e09 (patch)
tree5f7d8aba3d1a4af0c385cce289e549ecb4676e44
parent1da20b4fbcad605f2caebc29871932d9e4390ca4 (diff)
Emición de la señal 'new_select'
Signed-off-by: Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org>
-rw-r--r--InfoNotebook.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/InfoNotebook.py b/InfoNotebook.py
index a4389a7..60d17e4 100644
--- a/InfoNotebook.py
+++ b/InfoNotebook.py
@@ -86,6 +86,10 @@ class Introspeccion(Gtk.TreeView):
TreeView para la Introspección
"""
+ __gsignals__ = {
+ 'new_select': (GObject.SIGNAL_RUN_FIRST,
+ GObject.TYPE_NONE, (GObject.TYPE_STRING,))}
+
def __init__(self):
Gtk.TreeView.__init__(self,
@@ -93,7 +97,18 @@ class Introspeccion(Gtk.TreeView):
Gdk.Color))
self.__set_columnas()
+
self.show_all()
+
+ def do_row_activated(self, path, column):
+ """
+ Emite la señal new_select cuando se hace doble click sobre una fila
+ """
+
+ iter = self.get_model().get_iter(path)
+ texto = self.get_model().get_value(iter, 0)
+
+ self.emit('new_select', texto)
def set_introspeccion(self, nombre, texto):
"""
@@ -102,7 +117,7 @@ class Introspeccion(Gtk.TreeView):
"""
self.get_model().clear()
-
+
if not texto: return
analisis = re.compile(r'(^[ \t]*?class\s.*[(:])|(^[ \t]*?def\s.*[(:])|(^[\t]*?import\s.*$)|(^[ \t]*?from\s.*$)|(^\s*#---.+)', re.MULTILINE)
@@ -183,7 +198,7 @@ class Introspeccion(Gtk.TreeView):
"""
render = Gtk.CellRendererText()
- columna1 = Gtk.TreeViewColumn('Datos', render, text=0)
+ columna1 = Gtk.TreeViewColumn('Datos', render , text=0)
columna1.add_attribute(render, 'foreground-gdk', 1)
self.append_column(columna1)