After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727738 - Unable to change position value in insert_text handler when using Python gi.repository
Unable to change position value in insert_text handler when using Python gi.r...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 770639 (view as bug list)
Depends on: 644927
Blocks:
 
 
Reported: 2014-04-07 11:44 UTC by Marcin Szewczyk
Modified: 2018-05-02 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcin Szewczyk 2014-04-07 11:44:45 UTC
Specification[1] suggests that the position parameter is in/out. When using Python and gi.repository.Gtk the handler is called with an int (not by reference) which makes it impossible to adjust the position's value.

One can find an example suggesting that adjusting this parameter should be used to adjust the cursor's position when inserting text[2].

As a workaround one can try to use idle_add() or timeout_add(), but it's a dirty solution[3].

[1] http://lazka.github.io/pgi-docs/api/Gtk_3.0/interfaces/Editable.html#gtk-editable-signals-insert-text
[2] http://stackoverflow.com/questions/18674005/gtk-entry-set-position-doesnt-move-the-cursor
[3] http://stackoverflow.com/questions/11421376/pygtk-when-filtering-keyboard-input-to-an-entry-widget-cant-correctly-set-the
Comment 1 Christoph Reiter (lazka) 2014-04-08 13:33:52 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=644927

Out arguments in signals aren't supported in PyGObject atm.
Comment 2 Marcin Szewczyk 2014-04-08 19:33:36 UTC
Thank you for information. I will wait then, hoping it will be supported one day.
Comment 3 Christoph Reiter (lazka) 2017-03-29 19:07:42 UTC
*** Bug 770639 has been marked as a duplicate of this bug. ***
Comment 4 GNOME Infrastructure Team 2018-05-02 16:01:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/481.