Reputation: 253
Typing Ctrl-F
on a GtkTreeView enables a popup where a search-term can be inserted.
I want to disable this popup, since I want to use Ctrl-F
for another purpose.
Also, the amount of data displayed is quite large, so typing something in the popup freezes the whole application for a few seconds.
This does not answer the question, since the docs of gtk_tree_view_set_enable_search()
state:
Note that even if this is FALSE, the user can still
initiate a search using the “start- interactive-search” key binding.
I tried the following without any noticeable effect:
gtk_treeview_set_enable_search(false)
gtk_treeview_set_search_column(-1)
start-interactive-search
and return True
for "handled!".Im using Gtk+-3.12.
Any hint?
Upvotes: 0
Views: 398
Reputation: 253
Solved it.
Either use gtk_binding_entry_remove()
to unbind Ctrl-F
on the TreeView, or use
something along the following lines:
css_provider = Gtk.CssProvider()
css_provider.load_from_data("""
@binding-set unbind_search { unbind "<Control>f"; }
GtkTreeView { gtk-key-bindings: unbind_search; }
""".encode('utf-8'))
context = Gtk.StyleContext()
context.add_provider_for_screen(
Gdk.Screen.get_default(), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER
)
Upvotes: 1