Re: [gtkmm] Gtk::TreeView on gtkmm



Now it is me who is completely confused.
I do it this way: m_tree_sel_ref->signal_changed ()

Ok, I have major problems
because I still cannot make a selection highlighted :-(

Andi

  // Build ListStore/TreeView
  m_list_store_ref = Gtk::ListStore::create(m_columns);
  m_tree_view.set_model(m_list_store_ref);
  m_tree_view.set_rules_hint();
  m_tree_view.set_size_request();

  // Handle selection
  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));


If you connect a signal handler to Gtk::TreeView::signal_row_activated() you will catch double-clicks on rows, and also the user pressing enter when a row is highlighted. Single click to highlight the row is built in behaviour in a Treeview.

The signal handler to connect to signal_row_activated should have a prototype like

void handler(const Gtk::TreeModel::Path &, Gtk::TreeViewColumn*)




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