Changing background color of text in statusbar



Hi,

I've been trying to change the background colour for the text dispalyed in a statusbar, but I don't get it as I want it!

I simply want the background of the text to be red, but it seems to be quite difficult - or I've just missed something. (Probably the later :-)

I've tried a lot of things including use of 'private' variables in the GtkStatusbar structure!

The following sample code gives me a red frame and a little red square to the right in the statusbar - not quite what I want!



Sample code:
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_NORMAL, &red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_ACTIVE, &red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_PRELIGHT, &red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_SELECTED, &red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_INSENSITIVE, &red);
gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->frame, GTK_STATE_NORMAL, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->frame, GTK_STATE_ACTIVE, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->frame, GTK_STATE_PRELIGHT, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->frame, GTK_STATE_SELECTED, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->frame, GTK_STATE_INSENSITIVE, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->label, GTK_STATE_NORMAL, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->label, GTK_STATE_ACTIVE, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->label, GTK_STATE_PRELIGHT, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->label, GTK_STATE_SELECTED, &red); gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)->label, GTK_STATE_INSENSITIVE, &red);

if(GTK_LABEL(GTK_STATUSBAR(active_statusbar)->label)->mnemonic_widget != NULL)
      {

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)->label)->mnemonic_widget, GTK_STATE_NORMAL, &red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)->label)->mnemonic_widget, GTK_STATE_ACTIVE, &red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)->label)->mnemonic_widget, GTK_STATE_PRELIGHT, &red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)->label)->mnemonic_widget, GTK_STATE_SELECTED, &red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)->label)->mnemonic_widget, GTK_STATE_INSENSITIVE, &red);
      }


Best regards
Egon Andersen



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