GNOME Bugzilla – Bug 727738
Unable to change position value in insert_text handler when using Python gi.repository
Last modified: 2018-05-02 16:01:56 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
See https://bugzilla.gnome.org/show_bug.cgi?id=644927 Out arguments in signals aren't supported in PyGObject atm.
Thank you for information. I will wait then, hoping it will be supported one day.
*** Bug 770639 has been marked as a duplicate of this bug. ***
-- 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.