while this type of construction was working as expected with gtk2, there is a funny thing going on in gtk3. when the window is focussed, no color is shown, but when the window is out of focus, it is showing the color.

I have seen that the gtk_widget_modify_bg is deprecated in gtk 3 so I tried the suggested method with gtk_widget_override_background_color but there it seems that declaration of GdkColor colorRed2 = {0x0000, 65535, 29555, 24158} has changed to something like GdkRGBA.I tried to change to

No, that's not what I'm getting. I'm getting the button background colors for both the focused and unfocused window.Maybe it's a Fedora issue. I'm not sure. Maybe someone else who's running on Fedora can confirm the problem your having?I know it shouldn't be necessary here and more it's more work, but as a work-around you might try using CSS.

zerohour,you are right.The behavior I am getting only when I am using f17's theme Adwaita and few other gtk3 based theme. Old and tested themes like High/Low contrast are giving perfectly expected behavior.

As it is almost certain that this behaviour is due to f17's theme adwaita, I posted the topic in fedora forum as well(http://forums.fedoraforum.org/showpost. ... ostcount=4).So, is there any(other then css) way to override window managers's default theme, so that, the app will look same under all and any themes used?

Applications can override system-wide settings with gtk_settings_set_string_property(), gtk_settings_set_long_property(), etc. This should be restricted to special cases though; GtkSettings are not meant as an application configuration facility. When doing so, you need to be aware that settings that are specific to individual widgets may not be available before the widget type has been realized at least once. The following example demonstrates a way to do this:

Code:

gtk_init (&argc, &argv);

/* make sure the type is realized */g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));

Who is online

Users browsing this forum: Google [Bot] and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum