简体   繁体   中英

How to add a separator in a PyGTK combobox?

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

If this is not possible, what is the simplest way to use a gtk.TreeModel to able secuential widget addition?

I think that you should use ComboBox.set_row_separator_func to set a separator function where you would determine which items of your list will be separators. Since ListStore implements TreeModel interface, you should have no problem simply using it in your case.

PS: nothing is easy in GTK :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM