Damon Chaplin wrote:

> Matt Goodall wrote:
> >
> > Would it be possible to have a file (or better still, a window) for
> > setting the default properties for widgets as they are added to a window
> > design?
> >
> > I find that whenever I add a GtkLabel I automatically set the xalign to
> > "0" and the xfill to "Yes". This makes columns of labels in tables line
> > up at the left of the column. Another thing I tend to do is to add a
> > button box and then make its layout style "End" and set the spacing to
> > "5".
>
> I suspect that most labels are left-aligned and use xfill in tables.
> I think I'll make them the default within Glade. But first I'll check they
> don't affect any other widgets (e.g. in a button you want them centred.)
>
>
> > Having these defaults specified in a file would make building GUIs
> > *even* faster. Perhaps glade could use its default values unless
> > overriden by the file.
>
> It's quite a nice idea. I think it could be done, but it's a bit of work.

I think glade should probably default to whatever the GTK+ defaults are,
unless they're silly of course.

Anyway, the file format could be something similar to CSS (cascading style
sheets) so what I describe above could be written as:

GtkTable.GtkLabel {
    xalign: 0;
    xfill: True;
}

GtkButtonBox {
    layout-style: End;
    spacing: 5;
}

This wouldn't affect labels on buttons. You never know, some people might
actually like left aligned text in buttons and so they could set glade to do
that by default using this scheme.

The glade defaults could even be defined in the same way so that they're not
hard-coded.

Well, perhaps it's something to add to the to-do list for when all the other
features are finished :-).

Cheers, Matt.

--
* Matt Goodall, [EMAIL PROTECTED]
* Isotek Electronics Ltd
* Claro House, Servia Road, Leeds, LS7 1NL. England


begin:vcard 
n:Goodall;Matt
tel;fax:+44 113 234 2918
tel;work:+44 113 234 3202/3
x-mozilla-html:TRUE
org:Isotek Electronics Ltd
adr;quoted-printable:;;Claro House=0D=0AServia Road;Leeds;W.Yorks;LS7 1NL;England
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
x-mozilla-cpt:;-21184
fn:Matt Goodall
end:vcard

Reply via email to