vfuncs inheritance doesn't work
Hi,
Sorry for the issue title, but it's hard to put up in a few words. Anyway, I'm neither a C nor GObject specialist, but this looks like a bug to me.
Given I run the following code:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class CustomEntry(Gtk.Entry):
def do_insert_text(self, text, length, position):
print(self)
self.get_buffer().insert_text(position, text, length)
return length + position
if __name__ == '__main__':
win = Gtk.Window(title='Vfunc Inheritance Bug')
win.connect('delete-event', Gtk.main_quit)
box = Gtk.Box(spacing=6)
box.pack_start(Gtk.SearchEntry(), True, True, 6)
box.pack_start(Gtk.Entry(), True, True, 6)
box.pack_start(CustomEntry(), True, True, 6)
win.add(box)
win.show_all()
Gtk.main()
Typing one character in each of the three entries, gives the following output:
<Gtk.SearchEntry ...>
<Gtk.Entry ...>
<__main__.CustomEntry ...>
Expected output:
<__main__.CustomEntry ...>
Package | Version |
---|---|
python3 | 3.7.5 |
python3-gi | 3.34.0 |
libgi-repository | 1.62.0 |
libglib2.0 | 2.62.2 |
git1.2-gtk-3.0 | 3.24.12 |
Edited by Ghost User