Hi all, I am trying to get GtkSource’s CompletionWords work (in python), but I am failing at it. Please find below what I am trying:
import gi gi.require_version("Gtk", "4.0") gi.require_version("GtkSource", "5") from gi.repository import Gtk, GtkSource, GObject def on_activate(app): win = Gtk.ApplicationWindow(application=app) win.set_default_size(600,400) scroll = Gtk.ScrolledWindow() win.set_child(scroll) view = GtkSource.View.new() scroll.set_child(view) buf = view.get_buffer() provider = GtkSource.CompletionWords.new("main") provider.register(buf) completion = view.get_completion() completion.add_provider(provider) win.present() app = Gtk.Application() app.connect('activate', on_activate) app.run(None)
The completion does not start and I keep getting the warnings
Unsupported modifier, resource creation failed. XXX: resource creation failed
This happens both for Arch Linux and Fedora 36. What am I doing wrong? Thanks in advance.