Re: visual indication of the default button



In my dialog(s) is use gtk_widget_grab_default to set the "default" button
for the dialog. This works but I see no indication of this on the screen.
When a button gets the focus by using the tab key it is drawn with a black
border, but this is focus and not "default".

Does GTK have a visual indication of the default button, and if so how do I
activate it. By visual indication I mean something like Windows, the Mac,
and others do.

Have a look at this, it might help you,
(things starting with app or APP are my own)
I think GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
is what you are looking for.
Carlos

button = app_gtk_create_button ("Ok", "black");
gtk_widget_set_usize (button, APP_BUTTON_WIDTH, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (function_ok), data);

button = app_gtk_create_button ("Cancel", "red");
gtk_widget_set_usize (button, APP_BUTTON_WIDTH, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (function_cancel), data);




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