summaryrefslogtreecommitdiffstats
path: root/generic/tkFont.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkFont.c')
-rw-r--r--generic/tkFont.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 3e4044f..71008bc 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -897,6 +897,7 @@ RecomputeWidgets(
{
Tk_ClassWorldChangedProc *proc =
Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc);
+ TkWindow *tkwinPtr;
if (proc != NULL) {
proc(winPtr->instanceData);
@@ -912,18 +913,25 @@ RecomputeWidgets(
*
* However, the additional overhead of the recursive calls may become a
* performance problem if typical usage alters such that -font'ed widgets
- * appear high in the heirarchy, causing deep recursion. This could happen
- * with text widgets, or more likely with the (not yet existant) labeled
- * frame widget. With these widgets it is possible, even likely, that a
- * -font'ed widget (text or labeled frame) will not be a leaf node, but
+ * appear high in the hierarchy, causing deep recursion. This could happen
+ * with text widgets, or more likely with the labelframe
+ * widget. With these widgets it is possible, even likely, that a
+ * -font'ed widget (text or labelframe) will not be a leaf node, but
* will instead have many descendants. If this is ever found to cause a
* performance problem, it may be worth investigating an iterative version
* of the code below.
*/
- for (winPtr=winPtr->childList ; winPtr!=NULL ; winPtr=winPtr->nextPtr) {
- RecomputeWidgets(winPtr);
+ for (tkwinPtr=winPtr->childList ; tkwinPtr!=NULL ; tkwinPtr=tkwinPtr->nextPtr) {
+ RecomputeWidgets(tkwinPtr);
}
+
+ /*
+ * Broadcast font change virtually for mega-widget layout managers.
+ * Do this after the font change has been propagated to core widgets.
+ */
+ TkSendVirtualEvent((Tk_Window)winPtr, "TkWorldChanged",
+ Tcl_NewStringObj("FontChanged",-1));
}
/*
@@ -3780,7 +3788,7 @@ NewChunk(
if (layoutPtr->numChunks == maxChunks) {
maxChunks *= 2;
s = Tk_Offset(TextLayout, chunks) + (maxChunks * sizeof(LayoutChunk));
- layoutPtr = ckrealloc(layoutPtr, s);
+ layoutPtr = (TextLayout *)ckrealloc(layoutPtr, s);
*layoutPtrPtr = layoutPtr;
*maxPtr = maxChunks;