You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usage example
simple example in python, because my php app uses massive object dependencies
importgigi.require_version('Gtk', '3.0')
fromgi.repositoryimportGtk# Custom match function to filter completion resultsdefcustom_match_func(completion, key, iter, user_data):
model=completion.get_model()
text=model.get_value(iter, 0)
key=key.lower()
ifkeyintext.lower():
returnTruereturnFalse# Create a GtkEntryentry=Gtk.Entry()
# Create a GtkEntryCompletioncompletion=Gtk.EntryCompletion()
entry.set_completion(completion)
# Create a GtkListStore to hold the completion datastore=Gtk.ListStore(str)
completion.set_model(store)
# Add some completion datastore.append(['Apple'])
store.append(['Banana'])
store.append(['Cherry'])
# Connect the completion to the entrycompletion.set_text_column(0)
# Set the custom match functioncompletion.set_match_func(custom_match_func, None)
# Show the completioncompletion.set_popup_completion(True)
# Show the entrywindow=Gtk.Window()
window.add(entry)
window.connect("delete-event", Gtk.main_quit)
window.show_all()
Gtk.main()
Additional context
Seems that only one way to make search by mask %ppl%
because currently GtkListStore returns only substrings started with prefix appl%,
so this feature is wanted but not sure I know how to make callable implementation in cpp
The text was updated successfully, but these errors were encountered:
Not implemented exception.
GTK documentation
https://docs.gtk.org/gtk3/method.EntryCompletion.set_match_func.html
Usage example
simple example in python, because my php app uses massive object dependencies
Additional context
Seems that only one way to make search by mask
%ppl%
because currently
GtkListStore
returns only substrings started with prefixappl%
,so this feature is wanted but not sure I know how to make callable implementation in cpp
The text was updated successfully, but these errors were encountered: