Re: All button with the same size.



Hi,

Thanks for the response, GtkSizeGroup is a good solution.
It works fine now. Thanks.

Frédéric BRIAND wrote:

Hi,

I'm very new here and I've been using Gtk only for a short while.
Your question reminds me of one of the demo apps provided by the program gtk-demo. It's called "size groups". Here's the copy of the description:

Size Groups

GtkSizeGroup provides a mechanism for grouping a number of widgets together so they all request the same amount of space. This is typically useful when you want a column of widgets to have the same size, but you can't use a GtkTable widget. Note that size groups only affect the amount of space requested, not the size that the widgets finally receive. If you want the widgets in a GtkSizeGroup to actually be the same size, you need to pack them in such a way that they get the size they request and not more. For example, if you are packing your widgets into a table, you would not include the GTK_FILL flag.

Hope it helps.
I'll probably come here very soon, I've a lot of questions too...!



Danyel Bruggink a écrit :

The most effective way I've found to do it is to reconfigure your packing so that you pack all your buttons into the same box and create your hbox or vbox so that all the widgets in it are the same size (gtk_vbox_new(TRUE, 0)).

When I've been unable to figure out how to pack the window in a way that works with this, I have figured out how big the largest button would be doing a get_size_request and used that requisition to set the size of all the buttons.

If other people have other solutions I would love to hear them.

Danyel

On Thursday 14 October 2004 02:36 pm, Tobias wrote:

Hi all,

I've a little problem with buttons. The app uses x number of buttons,
the size depends on the content and gtk theme. I would want all the
buttons to be of the same size. I could hardcode
[gtk_widget_set_size_request()] a fixed size for all the buttons, but I
think that it's not a good solution.

Is there another way to make them of the same size? i.e. the size of the
biggest one.

Thanks.

---
Sorry for my horrible english.


_____________________________________
Check All Email Accounts Anywhere!
Check your POP3 and webmail account
from any PC. With no ads
http://www.fusemail.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






_____________________________________
Consolidate your email!
http://www.fusemail.com




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