Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/CeibalEncuesta
diff options
context:
space:
mode:
authorRogelio Mita <rogeliomita@activitycentral.com>2013-07-12 14:27:26 (GMT)
committer Rogelio Mita <rogeliomita@activitycentral.com>2013-07-12 14:27:26 (GMT)
commitfa4548cfc6a40948b5adea0dca9023a0aa2916bd (patch)
treef4b3de424cf045ad7e89e218f40b78f43a4ba25f /CeibalEncuesta
parent7bbc9a152b33a024daa84d3b94157bfc3e0b464f (diff)
GTK2: Select text when press in TextInput widget. Chaged TextInput widget width size
Diffstat (limited to 'CeibalEncuesta')
-rw-r--r--CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py b/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py
index 13eadfd..8f88fdc 100644
--- a/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py
+++ b/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py
@@ -1226,7 +1226,7 @@ class Widget_TextInput(gtk.Entry):
font_description = pango.FontDescription(OPTIONS_FONT_SIZE)
self.modify_font(font_description)
- self.set_size_request(int(OPTIONS_FONT_SIZE)*30, -1)
+ self.set_size_request(780, -1)
self.set_max_length(40)
self.nombre = "TextInput"
@@ -1240,8 +1240,23 @@ class Widget_TextInput(gtk.Entry):
text = self.options[key].get("text", False)
if text: self.set_text(text)
+ self.connect('event', self.__on_entry_clicked)
+ self.connect('focus-out-event', self.__out_focus)
+ self.has_focus = False
+
self.show_all()
+ def is_focused(self):
+ return self.has_focus
+
+ def __out_focus(self, widget, event):
+ widget.has_focus = False
+
+ def __on_entry_clicked(self, widget, event, data=None):
+ if not widget.is_focused() and event.type == gtk.gdk.BUTTON_RELEASE:
+ widget.select_region(0, -1)
+ widget.has_focus = True
+
def do_key_release_event(self, void):
"""
Cuando el usuario ingresa algún valor en la opción,