How to add separator to PyGTK combobox?

I use gtk.combo_box_new_text () to create a combobox list, this uses gtk.ListStore to store only strings, so is there a way to add a separator between items without using complex gtk.TreeModel?

If this is not possible, then what is the easiest way to use gtk.TreeModel to fully add additional elements?

+4
source share
1 answer

I think you should use ComboBox.set_row_separator_func to set the separator function, where you determine which elements of your list will be separators. Since ListStore implements the TreeModel interface, you should not have a problem just using it in your case.

PS: nothing works in GTK :)

+4
source

Source: https://habr.com/ru/post/1305931/


All Articles