Re: Signals question...



Bruno Tavares said:
The problem is that, when the cell is being edited, the key press
signals of the text entered in the cell are still emitted. Therefore i
get the signal in the window and do my stuff (that by the way changes
the focus and causes editing of the cell to stop). Any idea how to
prevent this?

key events actually go to the toplevel window from X, and gtk routes them to
the correct place.  so, for better or for worse, this is behaving as designed.
 ahem.

there's an "editing-done" signal on the GtkCellEditable, but no
"editing-begun" signal, so you can't really trap the editing state.

so next we have to look at the bigger picture...

what are you using key-press-event for?  is it something that could be
accomplished effectively (or even more-correctly) by using accelerators?

what happens  if you connect your key-press-event handler with
signal_connect_after?  (this will cause your handler to be run after the
default handler, which gives gtk a chance to mess with it first.)

-- 
muppet <scott at asofyet dot org>



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