Re: [gtkmm] How to make a selected row in a tree view highlighted



Same thing. The selection is not visible in the tree view.
I guess something is not right with my code?!

void ConstraintTable::onNextClicked()
{
  Gtk::TreeModel::iterator curr_iter = m_tree_sel_ref->get_selected();
  Gtk::TreeModel::Row curr_row = *curr_iter; // selected row

  typedef Gtk::TreeModel::Children type_children;
  type_children children = m_list_store_ref->children();

  for(type_children::iterator iter = children.begin(); iter != children.end(); ++iter)
  {
	Gtk::TreeModel::Row row = *iter;
	if(row)
	{
	  m_tree_sel_ref->select(row); // selection is ok but invisible
	  selection_made_cb(); // my callback for a selected row
	}
  }
}



...

  m_tree_sel_ref = m_tree_view.get_selection();

  m_tree_sel_ref->set_mode (Gtk::SELECTION_SINGLE);
  m_tree_sel_ref->signal_changed ().connect (
	SigC::slot (*this, &ConstraintTable::selection_made_cb));



What happens if for testing you try

m_tree_sel_ref->set_mode(Gtk::SELECTION_MULTIPLE);
m_tree_sel_ref->select_all();


I'm afraid I'm fairly new to Gtk, so am not an expert.




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