Re: [gtk-list] padding on buttons w/text




On Thu, 8 Oct 1998, Greg Fall wrote:
> an hbox inside the button and putting the label inside the hbox.  I'm
> not really bent out of shape about this (did it mostly as an exercise),
> but I'm wondering if there's an easy method I've missed, and/or if the
> extra widgets I used for my solution are for any reason a bad idea.
>

I don't think there's an easy method. But there's no real reason to do
this, as far as I can tell. All you get is a button that looks different
from every other Gtk button and overrides any user preferences affecting
this (maybe themes do? changing font sizes? in any case user prefs might
affect this eventually). In general setting absolute numbers when doing
your geometry is bad, if you can avoid it. You can't always, but you
shouldn't gratuitously hardcode things like this just because it looks
good on your particular screen. IMHO of course, user preferences should
never be written in C.

That's only an argument against doing this for all buttons though; a
particular button may have a reason to be big and spacious. In that case
your solution works, or you could also pack the button in a box with
expand set to TRUE, so that it grows to fill the box. That way you avoid
specifying the padding. The HBox (inside or out) probably uses some small
amount more memory than the regular button too, but not enough to be
important.

Havoc





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