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 761615 - Can't override GtkTextView's insert_text vfunc
Can't override GtkTextView's insert_text vfunc
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-05 23:34 UTC by Kai Willadsen
Modified: 2018-01-10 20:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (647 bytes, text/x-python)
2016-02-05 23:34 UTC, Kai Willadsen
Details

Description Kai Willadsen 2016-02-05 23:34:03 UTC
Created attachment 320520 [details]
Test case

Any override of this vfunc results in the following warning when called:

(buffertest.py:18458): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

I haven't figured out exactly what's required to trigger this; you'll see in the attached test case that a simple insert works, but if you type anything in the text view you should see this triggered straight away.

It's possible that this is a bug in GtkTextBuffer, but given that GtkSourceBuffer overrides this vfunc just fine, I'm guessing it's more likely an introspection issue.
Comment 1 Simon Feltman 2016-02-06 07:30:24 UTC
This might be related to bug 661469, although that bug is dealing with caller allocated out arguments but it does describe problems related to TextIters.

Is connecting to the "insert-text" signal a valid workaround for your use case?
Comment 2 Kai Willadsen 2016-02-06 21:14:50 UTC
Yes, the insert-text signal is what I'm currently using. I was just looking to use the vfunc to simplify some logic, so I can't call this urgent.
Comment 3 GNOME Infrastructure Team 2018-01-10 20:52:54 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/pygobject/issues/110.