[gedit-list] Capturing key-press-event

I was trying to capture key stroke events from the gedit window. To do
that, I wrote a call back function and tried to connect it to the
"key-press-event" of GeditView, inside the gedit_view_init() method in

      g_signal_connect (view,
                                 G_CALLBACK (gedit_myac_key_press_event),

and the call back function has the following prototype.

      gboolean gedit_myac_key_press_event(GeditView *view, GdkEventKey
* event, gpointer data);

But this produces a segmentation fault when run. I cannot identiyfy
the error. I tried connecting the signal from within GeditDocument and
GeditWindow the same way, but they all gave the same error. What I
expected was since both GeditWindow and GeditView derive from
GtkWidget, I would be able to connect my call back function to
GtkWidget's "key-press-event". But this was not successful. Can you
tell me what my method is not working? How can I correctly capture key
stroke events?

Thank you.
Ishan Jayawardena.

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