Re: Spacing



On 11 Sep 1997, Owen Taylor wrote:

> 
> I wanted to advocate that if somebody comes up with a good way of
> doing configurable spacing, it should probably go into into GTK
> itself. First, if fonts and colors are configured via the gtkrc, it
> would be logical to have spacing/padding configured there as
> well. Second, I think this capability is of general interest to
> anybody writing GTK programs, even if they aren't GNOME'izing them.

This is quite true.

> (Three less than good ways of doing it:
> 
>  * Add xspacing, yspacing, and border_width attributes to styles.
>    Then make the things like gtk_hbox_new() use these by default
>    if the value of spacing parameter is -1. (possibly with a #define)

I think this is the best, but perhaps not on a per-widget basis (ie not as
part of the styles).  

OTOH, what about using gtk_widget_set_name() on boxes that may need a
different config than the norm ?  Then, using styles, you could also
define a single style that only defines padding for all widget's.. 
eg.

style "default_padding"
{
  yspacing = 5
  xspacing = 5
}

widget_class "*" style "default_padding"

Which would work fine with the cool rc parsing system.  This would get
around the tinkering you'd otherwise have to do to set all the padding for
the widgets, and still allow you the flexibility to override them in
certain circumstances (using the named widget scheme). 

What'ya think ?

(and go for the #define too :)  I couldn't think of a good name for it
though.. I'm bad for that.)

Ian



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