Re: [gtkmm] TreeView: number of clicked column



"kick van bee" <kickvb linuxmail org> writes:

> A good way to do that is to create an object inheriting from
> Gtk::TreeViewColumn and that will keep the column number and connect
> to signal_clicked(). Then it can catch the click signal and pass it
> with the column number to my general function.
> 
> Is there another quicker way to to that?

You can do funky stuff with SigC::bind and pointers. Perhaps it can
help here. For example:

  void PreferencesWindow::on_checkbutton_changed(Gtk::CheckButton *checkbutton,
					         Glib::ustring key)
  {
    // process checkbutton, using key
  }

  PreferencesWindow::PreferencesWindow()
  {
    // ...

    checkbutton->signal_toggled()
      .connect(SigC::bind(SigC::slot(*this, &PreferencesWindow::on_checkbutton_changed),
			checkbutton, key));
    // ...
  }


-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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