Really fed-up how can i set call back on enter key of GtkTextView Widget. For which event i can listen?
Thanks.
Really fed-up how can i set call back on enter key of GtkTextView Widget. For which event i can listen?
Thanks.
gboolean on_key_press (GtkWidget * widget, GdkEventKey* pKey,gpointer userdata){
if (pKey->type == GDK_KEY_PRESS){
g_print("%i\n", pKey->keyval);
switch (pKey->keyval)
{
case GDK_Enter :
gtk_main_quit ();
break;
}
}
return FALSE;
}
Callback can be registered using :
GtkWidget *view;
view = gtk_text_view_new();
g_signal_connect(view, "key_press_event", G_CALLBACK(on_key_press), NULL);
**
Please visit this page for more information :
**