3

I have a GtkEntryCompletion declared as follows:

<object class="GtkEntryCompletion" id="search_entry_completion">
    <property name="model">menu_treestore</property>
    <property name="text_column">0</property>
</object>

The model is a GtkTreeStore with two columns, and column 0 is rendered as the text that should appear in the entry completion. The problem is that as it is a GtkTreeStore, only the parent items are used in the completion.

So, for example, if I have:

test0
    test00
    test01
test1

Only test0 and test1 will be available for the entry completion. I can't change the model to a GtkListStore, so, is there a way to make all items of the GtkTreeStore available for the entry completion? I'm using Python and Glade for the development of that task.

joaopaulopaiva
  • 363
  • 3
  • 16
  • Don't know anything about this widget, but maybe check the documentation on [GtkEntryCompletion](https://developer.gnome.org/gtk3/stable/GtkEntryCompletion.html). I quote: "By default, the matching is done by comparing the entry text case-insensitively against **the text column of the model** (see gtk_entry_completion_set_text_column()), but **this can be overridden with a custom match function** (see gtk_entry_completion_set_match_func())." – Daniel F. Dec 21 '18 at 23:29
  • @DanielF. and joaopaulo, I did some research on this and it seems the Treestore is searched for all entries, but the completion GUI is not setup to display the Tree hierarchy. I have an interest in this, if I find a solution, I will post here. – theGtknerd Dec 22 '18 at 14:16
  • Ok, so a GtkEntryCompletion uses a GtkTreeModelFiltered internally, and any EntryCompletion or Combobox will not show child nodes of a filtered model. Off to Gtk master devs to see what can be done about it... – theGtknerd Dec 23 '18 at 22:01
  • 1
    A hint... you can use a Treeview and a filtered store as a temporary workaround for now... that does work. – theGtknerd Dec 23 '18 at 22:03
  • 1
    For reference, https://gitlab.gnome.org/GNOME/gtk/issues/1541 – theGtknerd Dec 23 '18 at 22:43

0 Answers0