Re: backgroud colour - HELP



Stephane Konstantaropoulos wrote:
On Tue, 14 Jan 2003, Steve & Patti Getzinger wrote:


Stéphane Konstantaropoulos wrote:

Hello people,

I am developping Lumiere, video player for gnome 2.

It is in gtk 2.

I have a problem with the colour of the background, what happens is:

        The player is a GtkBin containing a GtkSocket.
        The GtkSocket, I resize to keep the aspect ratio, so it does not hold
all the space allowed by the window in which it is.

        THe window is a bonobo window and it embeds the player via a
bonoboPlug.

I found that the GtkBin shrinks according to the size of the GtkSocket,
so changing the color of the gtkbin is useless.

What is the problem then? The area around the GtkBin and it's container,
the bonobo window. So I tried to change the window background, it does
it but then when I load the player widget in it, it goes back to the
default background colour...

How can I do this? Is there a way of setting some kind of "default
background" or some thing like that??

Thanks for your help


Here is what I use. Thanks Eric Harlow :)


void SetStyle (GtkWidget *widget, gpointer data)
       {
               GtkStyle *style;

               style = (GtkStyle *) data;

               gtk_widget_set_style(widget,style);

               if(GTK_IS_CONTAINER(widget))
               {
               gtk_container_foreach(GTK_CONTAINER(widget),SetStyle,style);
               }
       }

Hope that helps,
Steve


Well it would if you advised which container to use as the top one...
The GtkBin I repeat is displayed as a GtkPlug, so setting its container
has no effect. I tried setting the GtkBin, it just worked but only for
the area of its child, around it it remains the default style...

More ideas??


What is the state defined? Have you tried ACTIVE along with NORMAL? Sounds to me you are hitting it (ACTIVE) and it is setting the color based on the ACTIVE state def's. What I sent you sets the style (predefined) of all children to the style of the parent if the parent is a container. I have no idea what base is but have you tried base instead of bg? base has appeared the same to me as bg but I am confident there is a difference or it would not be a separate var.

Hope that helps
Steve




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