Author: reinhard
Date: 2007-07-30 13:01:26 -0500 (Mon, 30 Jul 2007)
New Revision: 9769

Modified:
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
More fixes for wx2.8.


Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2007-07-30 
17:41:13 UTC (rev 9768)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2007-07-30 
18:01:26 UTC (rev 9769)
@@ -318,22 +318,29 @@
 
     def __on_gtk_text_changed(self, event):
 
-        # In wx2.8, the widget may not yet have the focus. However, we must
-        # make sure the event arrives at the correct widget.
-        widget = event.GetEventObject()
-        self._gfObject._event_set_focus(self.widgets.index(widget))
-
         # FIXME: workaround for issue-144.  Setting a selection within an
         # EVT_TEXT event does not work on wx.GTK, so we defer the replace-event
         # to the next idle loop.
         # We do not pass the position here because it's not correct - the
         # cursor position is not yet updated at the time this is called. So we
         # let the GF* logic figure out the new cursor position.
-        wx.CallAfter(self._request, 'REPLACEVALUE', text=event.GetString())
+        widget = event.GetEventObject()
+        index = self.widgets.index(widget)
+        wx.CallAfter(self.__deferred_gtk_text_changed, text=event.GetString(),
+                index=index)
 
         event.Skip()
 
+    # -------------------------------------------------------------------------
 
+    def __deferred_gtk_text_changed(self, text, index):
+
+        # In wx2.8, the widget may not yet have the focus. However, we must
+        # make sure the event arrives at the correct widget.
+        self._gfObject._event_set_focus(index)
+
+        self._request('REPLACEVALUE', text=text)
+
     # -------------------------------------------------------------------------
 
     def __on_key_down(self, event):



_______________________________________________
commit-gnue mailing list
commit-gnue@gnu.org
http://lists.gnu.org/mailman/listinfo/commit-gnue

Reply via email to