GTK+ FAQ
<<< Previous | Development with GTK+: widget specific questions | Next >>>

# How do I make a GtkEntry widget activate on pressing the Return key?

The Entry widget emits an 'activate' signal when you press return in it. Just attach to the activate signal on the entry and do whatever you want to do. Typical code would be:

      entry = gtk_entry_new();
      gtk_signal_connect (GTK_OBJECT(entry), "activate",
                          GTK_SIGNAL_FUNC(entry_callback),
                          NULL);

<<< Previous | Home | Next >>>
I can't add more than (something like) 2000 chars in a GtkEntry. What's wrong? | Up | How do I validate/limit/filter the input to a GtkEntry? [GTK 2.x]