Re: can we add checkbox as a Item in gtktreeview





Hi
I have handle "toggled signal on a tree view but when signal fire on check box all check boxes present n different rows are selected. This is the some line of code which i used to fire signal on GtkCellToggleRenderer.

m_pRendererCheck  = gtk_cell_renderer_toggle_new();
gtk_tree_view_column_set_attributes(pTreeCol, m_pRendererCheck, "activatable", TRACK_TOOGLE_BOX_COL, NULL);

g_signal_connect((gpointer) m_pRendererCheck, "toggled", G_CALLBACK (OnCellToggled), this);

OnCellToggled()
{
gboolean bActive = gtk_cell_renderer_toggle_get_active (pCellRenderer);
	if (bActive)
		bActive = FALSE;
	else
		bActive = TRUE;

	gtk_cell_renderer_toggle_set_active(pCellRenderer, bActive);
}

plz tell me how i can handle one checkbox in once time.


From: Daniel Kasak <dkasak nusconsulting com au>
To: Hum Tum <s_i_uk hotmail com>, gtk-list gnome org
Subject: Re: can we add checkbox as a Item in gtktreeview
Date: Fri, 03 Nov 2006 09:46:49 +1100

Hum Tum wrote:

Helo all,

I want to use checkbox as a item in GtkTreeView with the + sign to expand the tree. Can i select multiple rows in treeview using checkbox or any other alternate to handle this. Also i want to store information along these rows. I want to achieve what is in the figure attached.

You can put a GtkCellRendererToggle as your 1st column, and then connect some code to it's "toggled" signal to activate all the other stuff underneath it in the tree.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.c

_________________________________________________________________
Windows Live? Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb




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