list box in gtk
I have a file in which some text is stored. Now I want to display the text in a list box using gtk
. Ho开发者_如何转开发w can I do this?
Also the values are changing dynamically. Is there a way to refresh the listbox?
This is done using model-view architecture in GTK. The view is a GtkTreeView
, and you can associate it with a GtkListStore
, which you can update dynamically. The tree view will refresh automatically when you update the list store.
You might also want to read this overview of tree and list widgets in GTK.
精彩评论