tags:

views:

102

answers:

1

Really fed-up how can i set call back on enter key of GtkTextView Widget. For which event i can listen?

Thanks.

+1  A: 
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 :

**

atv
Oh! got it. do you know how we can change text size and color of GtkTextView?
PP