Re: Setting STYLE->FONT problems



Here are some rules that might help.

First, when you use gdk_font_load() to get yer font in the first place,
you need to know that in gives you 1 + refcount of whatever the font has
already. So you own one refcount.

When you copy a style using gtk_style_copy() it will increase the refcount
on the style's font by one.

When you unref a style it will decrease its font refcount for you (so
that balances out with when you copy the style).

So it's probable that when you loaded a font, you automaticaly
got one increased refcount but when you set the style's font you either
didn't unref the style's current font or still have an extra ref count on
an existing font that you loaded.




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.


--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/





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