Re: g_signal_emit()



On Sun, Aug 31, 2008 at 2:08 PM, dhk <dhkuhl optonline net> wrote:
I have two callback functions.  The first for when a cell in a treeview
gets edited and the second for when the tab key is pressed.  The first works
fine.  In the second, I want to emit the "edited" signal so it acts as if
the first event happened.  However, the g_signal_emit() in the
"key-press-event" callback does not seem to work.

I am doing the following and the renderer and sig_id are valid.

sig_id=g_signal_lookup("edited", G_OBJECT_TYPE(renderer));
g_signal_emit(renderer, sig_id, 0);

It looks like you are trying to emit the edited signal here without
specifying the correct arguments.

In short what I'm trying to do is emit the "edited" event when the
"key-press-event" occurs.  That way when the use tabs off the cell in the
treeview the callback for the "edited" event is called.  It doesn't make
sense the if there are two way to leave a cell (tabbing off it or clicking
outside of it) that you can't call the same event.

Maybe you can try using gtk_cell_editable_editing_done() here?  The
editing-done signal handler of the respective cell editable will take
care of emitting the edited signal.  You can get hold of the correct
cell editable by listening for the editing-started signal on the cell
renderer.


regards,

-kris.



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