Re: Changing fonts in Glade

I dont use glade much, but I assume that it does not do any style
modifications for is some code to get you on your way:

static void
gtk_label_set_font(GtkWidget *label, const gchar *font)
    GtkFont *old_font;
    GtkStyle *old_style;
    GtkStyle *style;
    old_style = gtk_widget_get_style(label);
    style = gtk_style_copy(old_style);
    old_font = style->font;
    style->font = gdk_font_new(font);
       style->font = old_font;
    gtk_widget_set_style(widget, style);

No guarantees as to the perfection of this code...its all dont on the
fly, but I've written similar stuff before and it looks pretty sane.


On 27 Aug 2001 09:54:41 -0400, Flavio Alberto Lopes Soares wrote:
> There's some way to change fonts for Label Widget (for example) and
> other widgets direct in Glade and generate the correct code when I build
> the project or the only way is adding code in C code generated ?
> Thankx
> flavio
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
-- - My pet project - My personal website

./configure --prefix=/dev/mocha --enable-caffeine

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