[SOLVED] GtkCellRendererToggle toggles when clicking on other cell renderers in same column
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
GtkCellRendererToggle toggles when clicking on other cell renderers in same column
I am working on a C++ GTK project. I have a GtkTreeView containing several columns. In the first column, I have packed in 3 cell renderers - the first, a GtkCellRendererToggle; the second, a GtkCellRendererPixbuf; the third, a GtkCellRendererText. Everything works fine, except that clicking on the text in the GtkCellRendererText causes the 'toggled' event to fire on the GtkCellRendererToggle. This is no good in this particular case. Is there any way, besides keeping track of where the mouse pointer is, to determine whether the user clicked on the checkbox itself or another cell renderer in the same column? Thanks in advance for any ideas.
/*sixth column - name of package used to fulfill requirement, if one is needed*/
"editable", true, NULL);
g_signal_connect(renderer, "edited", G_CALLBACK(on_pkgPropDependencies_depVersionCombo_changed), NULL);
column=gtk_tree_view_column_new_with_attributes("Version to Be Installed", renderer, "text", PKG_PROP_DEPENDENCIES_COLUMN_VERSION, NULL);
Last edited by grumpybuffalo; 08-10-2009 at 04:52 PM.
Reason: Forgot to say thanks.
I changed the GtkCellRendererText to a GtkCellRendererCombo. I didn't add any items to the combo or even set the model of the combo; the only property I set was the "editable" property to true. This created exactly the functionality I was looking for. The user can't even tell that the cell renderer is a combo box, because it has nothing in it. Clicking on the combo does not toggle the GtkCellRendererToggle. I suppose this is because GTK no longer considers the column one activatable entity.