Re: key_press_event



On Wed, 12 Sep 2001, Tamara wrote:

 Hi, 

 Use the following for Enter only:

gtk_signal_connect(GTK_EDITABLE(entry),"activate",gtk_button_clicked,your_button);

> Hi!
> I've a window with an entry and a button, I'd like that when I fill the
> entry and I press "return" (for example) the button will be clicked.
> I wrote:
> 
> gboolean on_entry_key_press_event (GtkWidget *widget,GdkEventKey
> *event,gpointer user_data)
> {
> 	gtk_butto_clicked (lookup_widget (GTK_WIDGET (widget), "buttonName"));

 The 'widget' here is your entry (or whatever widget you connect
"key-press-event" signal handler for - it should be the window with the entry
for lookup_widget to succeed.

 Best regards,
  -Vlad





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