Re: size of the font



/*
   standard font for all widgets that you instantiate after the call to 
   gtk_widget_set_default_style(style);
*/
#include <gtk/gtk.h>

void ok_func (GtkWidget *widget, GtkWidget *window) {
    gtk_widget_destroy(window);
    gtk_main_quit();
}
int main (int argc, char *argv[]) {
    GtkWidget *window, *vbox, *label, *separator, *button;
    GtkStyle *style;

    gtk_set_locale();
    gtk_init(&argc, &argv);

/* this is the code you're interested in */
    style = gtk_widget_get_default_style();
    style->font = gdk_font_load(
        "-adobe-symbol-medium-r-normal--34-240-100-100-p-191-adobe-fontspecific"
    );
    gtk_widget_set_default_style(style);
/* end */

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
    gtk_signal_connect(GTK_OBJECT(window), "destroy",
            GTK_SIGNAL_FUNC(gtk_exit), NULL);
    gtk_container_border_width(GTK_CONTAINER(window), 0);

    vbox = gtk_vbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(window), vbox);

    label = gtk_label_new("ICQUS");
    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);

    separator = gtk_hseparator_new();
    gtk_box_pack_start(GTK_BOX(vbox), separator, FALSE, FALSE, 0);

    button = gtk_button_new_with_label("OK");
    gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
            GTK_SIGNAL_FUNC(ok_func), GTK_OBJECT(window));
    gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
    GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
    gtk_widget_grab_default(button);

    gtk_widget_show_all(window);
    gtk_main();
    return(0);
}



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