Unable to change position value in insert_text handler when using Python gi.repository
Submitted by Marcin Szewczyk
Link to original bug (#727738)
Description
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
Version: 3.10.x