Re: GtkEntry and default buttons. GtkEntry eats the "Enter"



Hi Norman, you can also do a grab_default to get the OK button to
highlight when the entry has focus. gtkfilesel does this:

-- 
  gtk_signal_connect_object (GTK_OBJECT (entry), "focus_in_event",
    GTK_SIGNAL_FUNC (gtk_widget_grab_default), GTK_OBJECT (ok_button));
  gtk_signal_connect_object (GTK_OBJECT (entry), "activate",
    GTK_SIGNAL_FUNC (gtk_button_clicked), GTK_OBJECT (ok_button));
-- 

HTH, John

Jeff Shipman wrote:

Hook up the "activate" signal of the entry to
emit the "clicked" signal on your default button.

Jeff "Shippy" Shipman     E-Mail: shippy nmt edu
Computer Science Major    ICQ: 1786493
New Mexico Institute of Mining and Technology
Homepage: http://www.nmt.edu/~shippy

On Tue, 27 Mar 2001, Norman Black wrote:

I have a dialog with a GtkEntry (GtkCombo also has this issue) and the
dialog has a default button.
Entering text and pressing Enter does not activate the default button. You
have to tab off of any control with a GtkEditable and then you can press
enter to activate the default button.

How can I get the desired behavior. I must be missing something because this
is too obvious to have been missed.

Best Regards,
Norman Black
Stony Brook Software




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