Subject: Font hell tk4.2=>8.x Solution - DN [1]
bellenot@math.fsu.edu (Steve Bellenot) - 16 Nov 1999 - comp.lang.tcl
I have this widget which needs a font. In tk4.2 its control structure
has a field of the form
XFontStruct *fontPtr;
which is used exactly once as part of Tk_GetGC in the XGCValues-type
gcValues parameter via
gcValues.font = this->fontPtr->fid.
This fontPtr field is being filled in by Tk_ConfigureWidget by a Tk_Font
object which also has an fid field (but not in the same location). It
seems like the simple fix of changing the control structure to
Tk_Font *fontPtr
would work, but it does not compile. Or at least it does not compile
if it only includes tk.h. But after changing the assignment above to
gcValues.font = Tk_FontId(this->fontPtr);
life was good again.
I was kind of surprized both that this wasn't a FAQ and that I did not
get any pointers from my original post.
--
bellenot@math.fsu.edu http://www.math.fsu.edu/~bellenot (850)644-7189 (4053fax)
Last modified
1999-11-25
1999-11-25
(195.108.246.50)
Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated
