Re: gtk_widget_grab_default and gtk+-2.0



Oliver Rauch <oliver rauch rauch-domain de> writes:

Can anyone tell me if there is a way to make

 gtk_widget_grab_default(button);

work with gtk+-2.0. At least it does not work with this code
that worked with gtk+-1.2:

  button = gtk_button_new_with_label(BUTTON_CLOSE);
  GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
  gtk_widget_grab_default(button);
  gtk_widget_show(button);

It also does not work in the examples directory in gtk+-2.0


It should still work, I believe. The default is drawn a bit
differently, however, so perhaps you just aren't seeing the visual
indication? If you press Return does it activate the button you
expect?

Also with GtkDialog you can use gtk_dialog_set_default_response()
instead.

Havoc



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