[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Default button sizes
- From: carlos pehoe civil ist utl pt (Carlos Pereira)
- To: gtk-app-devel-list gnome org
- Subject: Re: Default button sizes
- Date: Tue, 4 Nov 2003 19:06:44 +0000 (WET)
>When I set a button to be default with a call to
>gtk_widget_grab_default(...), it gains a border showing its default.
>However, as a side effect of this the button appears smaller than any
>other
>buttons. I've noticed in most GTK apps this is not the behaviour (for
>example the file selection dialog).
>
>How do I ensure the button remains the same size, and the default border
>is
>around the outside.
Something like this will do,
Carlos
-------------------------
button = gtk_button_new ();
label = gtk_label_new ("Ok");
gtk_container_add (GTK_CONTAINER (button), label);
gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
gtk_widget_show (label);
gtk_widget_set_usize (button, 85, 0); << set button size
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_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (static_ok), window);
gtk_widget_show (button);
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]