Gtk Change Font and font color for an application

前端 未结 2 979
北恋
北恋 2021-01-22 07:20

I am having one Gtk+ and C application in which i want to set the font to some XYZ font type and font color to blue, for all the labels and text in the application how can i do

2条回答
  •  春和景丽
    2021-01-22 07:55

    I also wanted to change the size of the font (because in the windows I don't see any common way how to modify general GTKMM's font size, and user wants bigger fonts because he has small screen).

    This works, when called before displaying window:

    style = formatString( "style \"my-style\" { font_name = \"Mono %i\" } class \"*\" style \"my-style\"", fontSize);
    gtk_rc_parse_string( style );
    

    This is a way to 'create application setting' and apply it on the fly. By the way, class "*" means that all items will have this style applied.

提交回复
热议问题