Thread: What compilation flags should I use to upgrade from GTK2 to GTK3?

  1. #16
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640

  2. #17
    Registered User
    Join Date
    Dec 2016
    Posts
    30
    How would you change the theme of the program to dark?

  3. #18
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    Quote Originally Posted by hikerFreak View Post
    How would you change the theme of the program to dark?
    From the command line you can do something like this:
    GTK_THEME=Adwaita:dark ./your_gtk_progam

    I'm not sure how to do it in the program code itself. You might look here.

    EDIT:
    Looks like you might just have to do this after gtk_init:
    Code:
        GtkCssProvider *css = gtk_css_provider_get_named("Adwaita", "dark");
        GdkScreen *screen = gdk_screen_get_default();
        gtk_style_context_add_provider_for_screen(
            screen,
            GTK_STYLE_PROVIDER(css),
            GTK_STYLE_PROVIDER_PRIORITY_USER);
    Last edited by algorism; 04-11-2017 at 05:10 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to display a 2D array as an image using GTK3+?
    By hikerFreak in forum C Programming
    Replies: 9
    Last Post: 04-02-2017, 05:52 PM
  2. How to design a progress bar button with gtk3 c code?
    By Alireza Alipour in forum C Programming
    Replies: 0
    Last Post: 02-09-2017, 09:54 AM
  3. Which toolkit should I use: gtk2+ or gtk3+?
    By hikerFreak in forum General Discussions
    Replies: 2
    Last Post: 12-10-2016, 02:59 AM
  4. I need help with GTK3 treeviews, and paneviews
    By KoRn KloWn in forum C Programming
    Replies: 6
    Last Post: 01-18-2013, 01:31 PM
  5. linux/gcc/gtk2 programming help
    By solarwind in forum C Programming
    Replies: 0
    Last Post: 02-05-2006, 08:58 PM

Tags for this Thread