Re: connect_after, key_press_event, Nautilus



Darin Adler <darin bentspoon com> writes:

In Nautilus, we have an signal handler for key_press_event. Under gtk 1.4,
we used gtk_signal_connect_full and made the actual handler be the
marshaller, so we could connect after and inspect the return value that was
going to be returned to the caller.

Is there a corresponding feature in the new glib signal handler functions? I
can do a connect_after, but how can I tell what the return value is?

If you connect after, you will never get called if the return value is 
TRUE. So, your old trick won't work. But you could:

 - connect_after to catch return_value=FALSE returns
 - connect to ::event-after to catch all key presses afterwards

You should be able to get the same information.

Still, I don't think that code is going to work at all when you add in 
input methods, etc.

If the answer is no, does anyone have some ideas for alternate
implementations? The source file in question is nautilus-location-bar.c.

It's a hack too, but more reliably, I think you can connect_after() to
::commit on entry->im_context.

Clearly, this is asking for a clean way to hook in an auto-complete in
GtkEntry, and a bug to that effect would probably be a good idea so
that next time we break this, you'll have a non-hack to go to.

Regards,
                                        Owen



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