Re: [gtkmm] Treeview help needed



Hi members,

I´ve tried with my list view but the headers are
not clickable at all. Any hints?

  m_list_store_ref = Gtk::ListStore::create(m_columns);
  m_list_store_ref->set_sort_column_id(1, Gtk::SORT_ASCENDING);  // <---------
  m_tree_view.set_model(m_list_store_ref);
  m_tree_view.set_headers_clickable();  // <---------



*.h:

	// TreeView of the columned list
	Gtk::TreeView m_tree_view;

	// TreeModel of the columned list
	Glib::RefPtr<Gtk::ListStore> m_list_store_ref;

        // Selection in current TreeView
	Glib::RefPtr<Gtk::TreeSelection> m_tree_sel_ref;


No need to handle that signal is all you want is beeing able to control the sorting by clicking on the column headers, though. That is handled automatically by the TreeView once you activate sorting.

For sorting use something like this:

treestore->set_sort_column_id(<your column to sort>,
Gtk::SORT_ASCENDING);




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