Glade and TreeView



I need some help with Gtk::TreeView and glade2 please...
So I'm using glade to build an GUI and I know that glade can only
provide textview widget and I need to fill the textview myself with
coding.

It's like this, I'm accessing treeview created with glade like this:

Gtk::TreeView* tv1 = 0;
refXml->get_widget("treeview1", tv1);

Now I have tv1 and I want to fill the row with a... let's say some
text or label.
I don't need a columns, just rows. How would I do that ?

I was trying to do it like this:


class ModelColumns : public Gtk::TreeModel::ColumnRecord
	{
		public:

		ModelColumns()
		{ add(col1); }

		Gtk::TreeModelColumn<Glib::ustring> col1;

	};
ModelColumns m_Columns;
  
Gtk::TreeView* tv1 = 0;
refXml->get_widget("treeview1", tv1);

Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
m_refTreeModel = Gtk::ListStore::create(m_Columns);
tv1->set_model(m_refTreeModel);
	
Gtk::TreeModel::Row row = *(m_refTreeModel->append());
row[m_Columns.col1] = "testing123";
row[m_Columns.col1] = "testing";
	
tv1->append_column("Name", m_Columns.col1);


But no luck.. the treeview was empty.
Thanks for the help.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]