Colors go away...



I have an application that builds a cpu front panel (blue in color)  It has
buttons for the toggle switches and
several option buttons on it.  Under RedHat 6.2 (gtk 1.2.10) it works fine... 
 Under the stock Redhat 7.3, the
it appears to be black and white (more black on gray) not color at all, the
buttons work, and the only thing 
that appears to not work is the colors (even where a button color is changed
from green to red to green on each
click of the button doesn't have colors).  
I build the application under 6.2 and tried it under 7.3 with this result so I
rebuilt it under 7.3 and
got the same result.

I use/set colors with the following:

GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
GdkColor black = { 0, 0x0000, 0x0000, 0x0000 };
GdkColor red   = { 0, 0xff00, 0x000f, 0x000f };
GdkColor blue  = { 0, 0x0fff, 0x0fff, 0xa000 };
GdkColor green = { 0, 0x0000, 0xf0ff, 0x0000 };
GtkStyle *whitebutton;
GtkStyle *blackbutton;
GtkStyle *redbutton;
GtkStyle *bluebutton;
GtkStyle *greenbutton;


void CreateStyles()
{
  whitebutton = Make_Style(black, black, white);
  blackbutton = Make_Style(white, white, black);
  redbutton   = Make_Style(black, black, red);
  bluebutton  = Make_Style(white, black, blue);
  greenbutton = Make_Style(black, black, green);
}

For example I use "gtk_widget_set_style(button, greenbutton)" to set a button
to green
and then call gtl_label_set() to set the text in the button again.  This code
will execute
as part of the callback functions (the CreateStyles() is called during
initialization).
I set the background color in initialization with a
gtk_widget_push_style(bluebutton) and then
build the window filling it with its buttons.  I thought I was doing
everything according to
the "book"  "developing Linux Applications with GTK+ and GDK" by Harlow. 
 
   Help!


--
-- /Tony Preston/  *Team Amiga*  Linux Developer since 1993
-- SR Principal Engineer//Scientist
-- Atlantic Science & Technology Inc.
-- BBS Number:609-953-8159, Citadel 68K, The Amiga Zone
-- Work: 609-485-0205 extension 181
-- Ask me why Cancer is really curable...




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