Part of code: GTK2 to GTK3


How can I port this part of code from GTK2 to GTK3 ?


	GdkScreen screen = gdk_screen_get_default();
    guint screenwidth = gdk_screen_get_width(screen);
    guint screenheight = gdk_screen_get_height(screen);


What I did is this:

The window must be realized for this to work. But I’m not sure if that’s a good solution; It also depends a bit what you need the screen size for, I suppose.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.