Re: GtkTreeView "activate" signal patch



Mikael Hermansson <tyan linux se> writes:

> I proposed to add a signal when doubleclick on an treeitem.
> 
> Reason:
> 
> To make it simple for the application programmer 
> to do what he/she wants when doubleclick an item instead
> of using the hard way by connect to "button_press_event"
> 
> Here is a patch implementing this by adding a "activate"
> signal. There should probadly also be an keybinding signal
> for this but I am not sure how this could be implemented.

I've been planning on adding a "row_activated" signal for a while, but
haven't done so as I've been trying to get the keyboard stuff under
control.

> Looks like GtkBinding only takes signals as arguments
> but this leads to an problem because I need to check
> if there is an item selected before the "activate" signal is 
> emited?

It's even more complicated then that, as you need to consider cells like
toggle buttons that can be activated on their own (see
tests/testtreefocus.c as an example of such an application).  Anyway,
I'll add the button click case here in the short term so you can start
using it, and we can add the keyboard activation later.

> Is this patch ok to submit?

Of course it's okay to submit. (-: I'll read through it and apply it,
though...

Thanks,
-Jonathan




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