Setting STYLE->FONT problems



Hi,

I use the following function to set styles on widgets in my code. The
font however does not change and when I close the program it throws the
following message:

Gdk-CRITICAL **: file gdkfont.c: line 219 (gdk_font_unref): assertion
`private->ref_count > 0' failed.

Any ideas?

THanks.


void
SET_WIDGET_STYLE(GtkWidget *Widget, GdkColor Normal, GdkColor Active,
                                               GdkColor Prelight,
GdkColor Selected,
                                               GdkColor Insensitive, int
File_type)
{
   GtkStyle *Widget_Style;

   Widget_Style = gtk_style_copy(gtk_widget_get_style(Widget));

   Widget_Style->bg[GTK_STATE_NORMAL] = Normal;

   Widget_Style->bg[GTK_STATE_ACTIVE] = Active;

   Widget_Style->bg[GTK_STATE_PRELIGHT] = Prelight;

   Widget_Style->bg[GTK_STATE_SELECTED] = Selected;

   Widget_Style->bg[GTK_STATE_INSENSITIVE] = Insensitive;

   if(File_type == 0)
   {
      Widget_Style->font = CC_GLBL->LNK_FILE_FONT;
      Widget_Style->fg[GTK_STATE_NORMAL] = Active;
   }

   if(File_type == 1)
   {
      Widget_Style->font = CC_GLBL->REG_FILE_FONT;
      Widget_Style->fg[GTK_STATE_NORMAL] = Selected;
   }

   if(File_type == 3)
   {
      Widget_Style->font = CC_GLBL->MENU_FONT;
   }

   gtk_widget_set_style (Widget, Widget_Style);
   gtk_style_unref(Widget_Style);
}



--
Marco Quezada
Aerospaceo Engineero
NLX Corporation
22626 Sally Ride Dr.
Sterling, VA, 20164
mquezada nlxcorp com
703-234-2100 x1028
http://www.nlxcorp.com







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