P
Patrick Plattes
Hello ML ,
i've started to write a small GUI with GTK. A lot of thinks work fine,
but I have one problem: I want to have a list - like the email list at
the usual mail client. Tutorials told me, that I have to use TreeView.
I created an instance of ListStore and added a row. I see the row, and
I'm able to click on the row (the row change the color) but i don't see
any text in the cells. Does anyone have an idea how to fix it?
Thanks and bye,
Patrick
here is my code:
list_store = Gtk::ListStore.new(String, String, String)
iter = list_store.append
iter[0] = "First"
iter[1] = "Second"
iter[2] = "Third"
view = Gtk::TreeView.new(list_store)
renderer = Gtk::CellRendererText.new
column = Gtk::TreeViewColumn.new("Foo", renderer)
column.resizable = true
view.append_column(column)
column = Gtk::TreeViewColumn.new("Bar", renderer)
column.resizable = true
view.append_column(column)
column = Gtk::TreeViewColumn.new("Mix", renderer)
column.resizable = true
view.append_column(column)
vbox.pack_start(view)
view.show_all
i've started to write a small GUI with GTK. A lot of thinks work fine,
but I have one problem: I want to have a list - like the email list at
the usual mail client. Tutorials told me, that I have to use TreeView.
I created an instance of ListStore and added a row. I see the row, and
I'm able to click on the row (the row change the color) but i don't see
any text in the cells. Does anyone have an idea how to fix it?
Thanks and bye,
Patrick
here is my code:
list_store = Gtk::ListStore.new(String, String, String)
iter = list_store.append
iter[0] = "First"
iter[1] = "Second"
iter[2] = "Third"
view = Gtk::TreeView.new(list_store)
renderer = Gtk::CellRendererText.new
column = Gtk::TreeViewColumn.new("Foo", renderer)
column.resizable = true
view.append_column(column)
column = Gtk::TreeViewColumn.new("Bar", renderer)
column.resizable = true
view.append_column(column)
column = Gtk::TreeViewColumn.new("Mix", renderer)
column.resizable = true
view.append_column(column)
vbox.pack_start(view)
view.show_all