Re: [gtkmm] Treeview help needed



Hi andreas,

You have to connect some callbacks indeed. take a look at
Gtk::TreeViewColumn::signal_clicked() 

This always works for me, but if i'm not mistaken Christer mentioned
another way of accomplishing this. So i'd like to hear more ;-)

grtz,

Bart

On Thu, 2004-04-15 at 23:32, Andreas B. Thun wrote:
> > I don't think it'll wors by just passing "1" as an argument. Try passing
> > a Gtk::TreeViewColumn.
> 
> Yes, you are right. It sorts by the column and that´s it.
> It does not matter which header I click on.
> 
> So I tried this but it does not work.
> I have the feeling that I have to connect callbacks to the
> headers ... somehow?
> 
> 
>    m_list_store_ref = Gtk::ListStore::create(m_columns);
> 
>    m_list_store_ref->set_sort_column_id(m_columns.m_col_active,      Gtk::SORT_ASCENDING);
>    m_list_store_ref->set_sort_column_id(m_columns.m_col_type,        Gtk::SORT_ASCENDING);
>    m_list_store_ref->set_sort_column_id(m_columns.m_col_id,          Gtk::SORT_ASCENDING);
>    m_list_store_ref->set_sort_column_id(m_columns.m_col_elements,    Gtk::SORT_ASCENDING);
>    m_list_store_ref->set_sort_column_id(m_columns.m_col_description, Gtk::SORT_ASCENDING);
> 
>    m_tree_view.set_model(m_list_store_ref);
> 
> 
> 
> .h:
> 
> 	// Tree model columns:
> 	class ModelColumnsTAB : public Gtk::TreeModel::ColumnRecord
> 	{
> 	public:
> 	  ModelColumnsTAB()
> 	  {
> 		add(m_col_active);
> 		add(m_col_type);
> 		add(m_col_id);
> 		add(m_col_elements);
> 		add(m_col_description);
> 	  }
> 	  Gtk::TreeModelColumn<Glib::ustring> m_col_active;
> 	  Gtk::TreeModelColumn<Glib::ustring> m_col_type;
> 	  Gtk::TreeModelColumn<Glib::ustring> m_col_id;
> 	  Gtk::TreeModelColumn<Glib::ustring> m_col_elements;
> 	  Gtk::TreeModelColumn<Glib::ustring> m_col_description;
> 	};
> 	const ModelColumnsTAB m_columns;
> 




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