zoukankan      html  css  js  c++  java
  • Gtk Label设置字体颜色

    GTK label 字体改变方法:

     

    代码
     1 /*label*/
     2 //lbl_test = gtk_label_new  (_("\345\255\227\344\275\223\346\265\213\350\257\225"));
     3 lbl_test = gtk_label_new (_("Label Test 测试"));
     4  PangoFontDescription *font_desc = pango_font_description_from_string("Sans");
     5  pango_font_description_set_size (font_desc, 25 * PANGO_SCALE);
     6  gtk_widget_modify_font (lbl_test, font_desc);
     7  gdk_color_parse ("red"&color);
     8  gtk_widget_modify_fg(lbl_test, GTK_STATE_NORMAL, &color);
     9  gtk_widget_show (lbl_test);
    10  gtk_box_pack_start (GTK_BOX (vbox1), lbl_test, TRUE, TRUE, 0);
    11  /*label end---*/
    12 
    13 
    14  /*button*/
    15  //button1 = gtk_button_new_with_mnemonic (_("button1"));
    16  button1 = gtk_button_new_with_label (_("button1"));
    17  //button1 = gtk_button_new_from_stock (GTK_STOCK_OK);
    18  //button1 = gtk_button_new_from_stock ("lbl_button");
    19  //gtk_button_set_use_sto
    20 
    21 

     

    字体编码转换:
    g_convert("打印", -1, "UTF-8", "GBK", NULL, NULL, NULL);
  • 相关阅读:
    hdu 1042 N!
    hdu 1002 A + B Problem II
    c++大数模板
    hdu 1004 Let the Balloon Rise
    hdu 4027 Can you answer these queries?
    poj 2823 Sliding Window
    hdu 3074 Multiply game
    hdu 1394 Minimum Inversion Number
    hdu 5199 Gunner
    九度oj 1521 二叉树的镜像
  • 原文地址:https://www.cnblogs.com/winnxm/p/1674127.html
Copyright © 2011-2022 走看看