[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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.