[gtk-list] How to change a label's font?



Hello,
 
  AT first, thank all who have answered my last question.
 
   I try to change the font of a label like this:
 
       label = gtk_label_new ("Quit");
       gdk_font_free (label->style->font);
       label->style->font = gdk_font_load
 ("-adobe-times-bold-i-normal--25-180-100-100-p-128-iso8859-1");
      gdk_font_ref (label->style->font);
 
 
   It works, but I don't like it, especially the free- and ref-thing.
The
 code looks dangerous and too low level. Have I done it right? Or are
 there better ideas?
 
 Cheng-Chang Wu



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