Re: Problem with setting button as default button




vprasad@applix.com (V G Prasad \[ext 294\]) writes:

> Hi,
> I am trying to set a Gtkbutton to be default button, and running
> into the following widget size issue
 
> button = gtk_button_new_with_label ("Button");
> /*gtk_widget_set_usize(button, 70, 22); */
> GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
>  gtk_widget_grab_default(button);
> gtk_widget_show (button);
 
> If I uncomment the setting of size above, the button is small. How
> do I take into account the size by which the default button grows
> when setting the button size?

Buttons that are set to CAN_DEFAULT request extra space for displaying
the default; GTK+ normally dynamically positions widgets so this extra
space it taken care of automatically --- gtk_widget_size_request()
when called on such a widget will simply return a bigger value.

The amount by which such a button are bigger is a pretty much fixed
value currently (it's 11 pixels in each direction for most themes),
but that might well change in the future.

I'm not sure if that answers the question...

                                        Owen



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