GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 30, 2014 5:55 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to make a toggle cell renderer activatable?
PostPosted: Thu Jan 12, 2012 7:55 pm 
Offline
Familiar Face

Joined: Thu Jan 12, 2012 7:44 pm
Posts: 7
Hello,

I've spent the last hours trying to make a toggle cell renderer activatable, but I still have no idea how to do this correct or why my solution doesn't work.

I just create an instance of the renderer with
Code:
togglerenderer = gtk_cell_renderer_toggle_new();

and create a column with
Code:
visible_col = gtk_tree_view_column_new_with_attributes(_("Visible"), togglerenderer,
                                                          "active", VISIBLE_COL, NULL);

Because the documentation says that the default value for activatable is TRUE, I supposed this should be enough to make the buttons activatable. But in fact, it happens nothing when I click on one of these.

Well, I also tried to set the activatable property explicit.
First try:
Code:
gtk_cell_renderer_toggle_set_activatable(GTK_CELL_RENDERER_TOGGLE(togglerenderer), TRUE);
Doesn't change anything. Second try:
Code:
visible_col = gtk_tree_view_column_new_with_attributes(_("Visible"), togglerenderer,
                                                          "active", VISIBLE_COL,
                                                          "activatable", TRUE,
                                                          NULL);
This ends in the following error message:
Quote:
GLib-GObject-WARNING **: unable to set property `activatable' of type `gboolean' from value of type `gchararray'

What else do I have to do to make the buttons (un)checkable by clicking on it with the mouse?

Thanks for answers.


Top
 Profile  
 
 Post subject: Re: How to make a toggle cell renderer activatable?
PostPosted: Thu Jan 12, 2012 9:42 pm 
Offline
GTK+ Geek

Joined: Fri Sep 04, 2009 6:53 am
Posts: 68
You must connect to the "toggled" signal and change your store yourself. Have a look at http://scentric.net/tutorial/sec-editab ... oggle.html.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group