Re: size of the font



..
void kiyoshis_font (GtkWidget *widget) {
    GtkStyle *style;

    style = gtk_widget_get_style(widget);
    style->font_desc = pango_font_description_from_string("fixed 20");
                        /* or whatever font and size you want */
    gtk_widget_set_style(widget, style);
}
..
int main (argc, char *argv[]) {
    GtkWidget *window, *label, *button;

    gtk_init(&argc, &argv);
..
    label = gtk_label_new("");
    kiyoshis_font(label);
    gtk_label_set_text("this is my label");
.. /* same thing for the button */

i couldn't find anything better for 2.0 in the api,
but in 1.2 there's a function called gtk_widget_set_default_style()
that i think might do the trick for you if you're using 1.2 .
(someone correct me if i'm wrong because i just read about it today
 and haven't used it in any code)

~sky



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