Re: Gtk font/style question



On Thu, Mar 09, 2000 at 11:51:36PM -0700, shunter@bigsky.net wrote:
> On Thu, Mar 09, 2000 at 09:22:07PM -0500, Matthew Guenther wrote:
> > Hi,
> > 
> > I'm trying to have a program I'm working on (Balsa) take the user's current
> > Gtk style font, make it bold, and then use that font in a CTree to
> > show which mailboxes have new mail.  However I can't figure out a way
> > to do this.  Although I can get the GdkFont, there doesn't seem to be
> > a way to get either the XLFD, or perform manipulations on the current
> > font.  Is there a way to do this from within the Gtk/Gdk framework?
> 
> The following is an ugly way to get the font xlfd.
> 
> #include <gdk/gdkprivate.h>
> 
> GdkFont* font = style->font;
> GSList *list = ((GdkFontPrivate*)font)->names;
> gchar *xlfd = (gchar*)list->data;
> 
> Since its a list, I suppose you might get more than one xlfd for a
> given GdkFont, but in my test it was only a one element list.
> 
> If anyone else has a cleaner way, please post here. I need to do
> this as well at some point.
> 

Thanks, I'll give that a try and do some testing.  If you want I can
drop you a note and tell you how it turns out later.

MBG

-- 
   Matthew Guenther                        "If value corrupts then absolute
   mguenthe@netcom.ca                      value corrupts absolutely."
   http://www.netcom.ca/~mguenthe/

PGP signature



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