Hello,

On Wed, Aug 12, 2009 at 2:32 AM, Grumpy
Buffalo<grumpybuffalo+...@gmail.com> wrote:
> Hi, 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

This is happening because the column that you have created has a
single activatable cell renderer.  The column is then seen as a single
activatable entity.  (It is more clearly seen in keyboard navigation,
when this column gets focus it will draw the focus indicator around
all cell renderers instead of around a single cell renderer, again
because there is only a single cell renderer that can be activated).
Often this is the behavior you want, for example when you pack a text
renderer next to the toggle renderer.  It will act the same as a
regular toggle button which also allows clicking on the text.

> GtkCellRendererToggle. This is no good in this particular case. Is

Why exactly is it no good in this case?  The contents packed together
in a column surely belong together in some way?


> 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.

The only way I can think of so quickly to work around this is probably
to subclass GtkCellRendererToggle and override the activate method to
check the event coordinates that are provided with the cell_area or
background_area coordinates. (GtkCellRendererToggle itself does not do
this and immediately emits the toggled signal).


regards,

-kris.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to