Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Garcia <cristian99garcia@gmail.com>2013-05-24 19:25:58 (GMT)
committer Cristian Garcia <cristian99garcia@gmail.com>2013-05-24 19:25:58 (GMT)
commit0678490b10dc1ef70ddbfe399eea0c08103df3fd (patch)
tree467876be0b4d9163923a002ea2c0923b2e74826f
parentd6cd8706103624da13734e54d1874c93d8847a1f (diff)
Agregando los botones 'Copiar' y 'Pegar' para la terminal
-rw-r--r--WorkPanel.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/WorkPanel.py b/WorkPanel.py
index 516db70..19475a1 100644
--- a/WorkPanel.py
+++ b/WorkPanel.py
@@ -469,5 +469,33 @@ class DebugNotebook(Gtk.Notebook):
Gtk.Notebook.__init__(self)
scrolled = Gtk.ScrolledWindow()
- scrolled.add(Terminal())
- self.append_page(scrolled, Gtk.Label('Terminal'))
+ self.terminal = Terminal()
+ vbox = Gtk.VBox()
+ hbox = Gtk.HBox()
+
+ scrolled.add(self.terminal)
+ vbox.add(scrolled)
+ vbox.pack_start(hbox, False, False, 5)
+
+ boton_copiar = Gtk.Button(None, Gtk.STOCK_COPY)
+ boton_pegar = Gtk.Button(None, Gtk.STOCK_PASTE)
+
+ hbox.pack_start(boton_copiar, False, False, 5)
+ hbox.pack_start(boton_pegar, False, False, 5)
+
+ boton_copiar.connect('clicked', self.__actuar_sobre_terminal, 'copiar')
+ boton_pegar.connect('clicked', self.__actuar_sobre_terminal, 'pegar')
+
+ self.append_page(vbox, Gtk.Label('Terminal'))
+
+ def __actuar_sobre_terminal(self, widget, accion):
+ """
+ Genera una acción sobre la terminal.
+ """
+
+ if accion == 'copiar' and self.terminal.get_has_selection():
+ self.terminal.copy_clipboard()
+
+ elif accion == 'pegar':
+ self.terminal.paste_clipboard()
+