Re: statusbar

with "color" being defined as a GdkColor.  (This is on gtk 2.x, but it might
work for 1.2 though..)

Thanks a lot, unfortunately it seems that this does not exist on gtk 1.2.x...

I might have a solution (see below), but first, I want 
to know how you got the background color to change? 

This is a possible solution (there are others):

event_box = gtk_event_box_new ();
gtk_box_pack_start (GTK_BOX (hbox), event_box, TRUE, TRUE, 0);
gtk_widget_show (event_box);

statusbar = gtk_statusbar_new ();
gtk_container_add (GTK_CONTAINER (event_box), statusbar);
context = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "message");
gtk_widget_show (statusbar);

gdk_color_parse ("red", &color);
rc_style = gtk_rc_style_new ();
rc_style->bg[GTK_STATE_NORMAL] = color;
rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG;
gtk_widget_modify_style (event_box, rc_style);
gtk_rc_style_unref (rc_style);

gtk_statusbar_push (GTK_STATUSBAR (statusbar),
GPOINTER_TO_INT (context), "Hello World");

A screenshot is here:

It is easy to set the foreground color on a label, but in a statusbar 
messages are popped/pushed entering directly the text (I could cast 
the statusbar to a hbox and then insert a label, but then I would 
end up with just a label in a hbox, not what I want...)

Looking into the rc_style structure might help... Moreover,
people writing themes might know about this... 

Again, thanks for your answer,


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