Button background in GTK_RELIEF_NONE



hi,

(using gtk+ 1.2)

I'm currently trying all possible ways of setting the background color of
label.  as per the faq, I have learned that we actually need to modify the bg
color of the object behind the label.

Trying that, I have searched for various types of object, I find only the
following which actually render a background:

 - button
 - entry
 - input
 - window

none of them except button with GTK_RELIEF_NONE can be applied underneat a
label, keeping the same look but with different bg color.

If I do the following, I get the actual styled background I have selected:

button = gtk_button_new_with_label( str_eax );
gtk_widget_show (button);
gtk_widget_set_style( button, blue_background );

which actually render a normal button with string defined in str_eax, having a
blue color button (background).

Doing the following to create a GTK_RELIEF_HALF also works:

button = gtk_button_new_with_label( str_eax );
gtk_button_set_relief( GTK_BUTTON (button), GTK_RELIEF_HALF );
gtk_widget_show( button );
gtk_widget_set_style( button, blue_background );

The problems comes when I change the GTK_RELIEF_HALF in the above code to
GTK_RELIEF_NONE.  The button doesn't appear to be blue anymore.  In fact, I
have tried setting all the 5 bg[] entries without success.  Tried also setting
the 5 fg[] entries, also without success.

2 questions arise from this:

1) Do any of you know why the actual button when set with GTK_RELIEF_NONE can't
get a different background then the one defined in the default style?

2) How can I actually create a window, with a bunch of labels with different
background colors? Is there any container that actually render a background
other than the one that I listed above?

well.. this is kinda 3 questions but still.

Thanks for any answer :)
-- 
bandai kaosu jikuu
EKS - Dave Poirier





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]