GTK+ change font to spin button

前端 未结 1 1158
盖世英雄少女心
盖世英雄少女心 2021-01-23 19:21

I created a spin button in GTK+ like this:

flow_spin = gtk_spin_button_new_with_range (100,1500,25);

and I want to change it\'s font and size.

1条回答
  •  闹比i
    闹比i (楼主)
    2021-01-23 19:43

    Gtk supports CSS for styling. You can load a CSS file in your program with gtk_css_provider_load_from_file().

    So, just add a style provider on GtkWidget you want to stylish.

    It's good read:

    • http://developer.gnome.org/gtk3/stable/theming.html
    • https://thegnomejournal.wordpress.com/2011/03/15/styling-gtk-with-css/

    0 讨论(0)
提交回复
热议问题