Python Forum

Full Version: Gtk.EntryCompletion, get all suggestions, not only beginning with entered string.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey there,

Have a Gtk.EntryCompletion connected to a textbox like this:
liststore = Gtk.ListStore(str)
f = open("vogelarten_dt.info", 'r').readlines()
for item in f:
    liststore.append([item[:-1]])

self.entrycompletion = Gtk.EntryCompletion()
self.entrycompletion.set_model(liststore)
self.entrycompletion.set_text_column(0)

self.entry = self.builder.get_object('Tbo_Species')
self.entry.set_completion(self.entrycompletion)
If i type something into my TextEntry, i got all suggestions from liststore, beginning with the entered string.
So if I type "bi", i get suggestions like "Bienenfresser", "Birkhuhn" or "Birkenzeisig".

How can I reconfigure the Gtk.EntryCompletion to also get suggestions not starting but containing "bi"? Have found a documentation about Python and GTK, but got no information about how to realize the described scenery.

Best Wishes,
TimeMen