/* Ubuntu 8.04 GTK+ でウィジェットのフォントを変更する例(和文等幅フォント) */
#include <gtk/gtk.h>
int main (int argc,char**argv) {
    const char*t="半角Widget\n全角Widget\n半角ウィジェット\n全角ウィジェット";
    GtkWidget*window,*hbox; GtkTextView*view1,*view2; GtkRcStyle*s;
    gtk_init(&argc,&argv); window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_set_size_request(window,240,70);
    gtk_container_set_border_width (GTK_CONTAINER(window),5);
    g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),0);
    hbox=gtk_hbox_new(FALSE,5); gtk_container_add(GTK_CONTAINER(window),hbox);
    view1=(GtkTextView*)gtk_text_view_new();
    gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(view1),TRUE,TRUE,0);
    view2=(GtkTextView*)gtk_text_view_new();
    gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(view2),TRUE,TRUE,0);
    s=gtk_widget_get_modifier_style(GTK_WIDGET(view2));
    s->font_desc=pango_font_description_from_string("Monospace 10");
    gtk_widget_modify_style(GTK_WIDGET(view2),s);
    gtk_text_buffer_set_text(gtk_text_view_get_buffer(view1),t,-1);
    gtk_text_buffer_set_text(gtk_text_view_get_buffer(view2),t,-1);
    gtk_widget_show_all(window); gtk_main(); return 0;
}