Re: connect().ing to a clickable treeview header
- From: Bob Caryl <bob fis-cal com>
- To: Doug McLain <doug nostar net>
- Cc: gtkmm-list gnome org
- Subject: Re: connect().ing to a clickable treeview header
- Date: Thu, 09 Mar 2006 08:19:50 -0600
Doug McLain wrote:
I've got a single column treeview with the header set to clickable via:
TreeViewColumn* col = tview->get_column (0);
col->set_clickable (true);
I use tview->signal_button_release_event().connect() to handle
selections to the treeview, but I also want to add some custom
functionality to the header (not for sorting). Clicking on the header
doesnt trigger tview->signal_button_release_event(), and I cant figure
out how to catch a click of the header. Anyone?
Doug
--
http://nostar.net/
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Since you have only one column you should add the following after the
code you show:
col->set_sort_column(<a column member of your derived column record
class goes here>);
col->signal_clicked().connect(sigc::mem_fun(*this,
&YourClass::your_callback_slot));
Now, your callback slot should look minimally look like this:
void YourClass::your_callback_slot(void)
{
tview->set_search_column(0);
}
Actually, the only reason i needed the callback slot was that in my
application, I had more than one column, so I needed to tell the
treeview upon which column to sort the records in the TreeModel.
Hope this helps.
Bob
begin:vcard
fn:Robert Caryl
n:Caryl;Robert
org:Fiscal Systems, Inc.
adr:;;102 Commerce Circle;Madison;AL;35758;USA
email;internet:bob fis-cal com
title:Senior Software Design Engineer
tel;work:356-772-8920 X108
x-mozilla-html:TRUE
url:http://www.fis-cal.com
version:2.1
end:vcard
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]