diff options
author | vincentdarley <vincentdarley> | 2003-11-15 02:33:47 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-11-15 02:33:47 (GMT) |
commit | 9ff1604c28de87ff02e5264cafea2222ea342295 (patch) | |
tree | ba9e32dbe2f68359525d8a6970e094993a73e5c4 /generic/tkTextWind.c | |
parent | ad62e056b67fe09a6a4ed1b048747fc3f0efd4bc (diff) | |
download | tk-9ff1604c28de87ff02e5264cafea2222ea342295.zip tk-9ff1604c28de87ff02e5264cafea2222ea342295.tar.gz tk-9ff1604c28de87ff02e5264cafea2222ea342295.tar.bz2 |
fix two more old text widget bugs
Diffstat (limited to 'generic/tkTextWind.c')
-rw-r--r-- | generic/tkTextWind.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index dd829a8..ab0a4e9 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextWind.c,v 1.9 2003/11/07 15:36:27 vincentdarley Exp $ + * RCS: @(#) $Id: tkTextWind.c,v 1.10 2003/11/15 02:33:51 vincentdarley Exp $ */ #include "tk.h" @@ -870,18 +870,21 @@ TkTextEmbWinDisplayProc(chunkPtr, x, y, lineHeight, baseline, TkTextSegment *ewPtr = (TkTextSegment *) chunkPtr->clientData; int lineX, windowX, windowY, width, height; Tk_Window tkwin; - + TkText *textPtr; + tkwin = ewPtr->body.ew.tkwin; if (tkwin == NULL) { return; } + + textPtr = ewPtr->body.ew.textPtr; if ((x + chunkPtr->width) <= 0) { /* * The window is off-screen; just unmap it. */ - if (ewPtr->body.ew.textPtr->tkwin != Tk_Parent(tkwin)) { - Tk_UnmaintainGeometry(tkwin, ewPtr->body.ew.textPtr->tkwin); + if (textPtr->tkwin != Tk_Parent(tkwin)) { + Tk_UnmaintainGeometry(tkwin, textPtr->tkwin); } else { Tk_UnmapWindow(tkwin); } @@ -894,10 +897,10 @@ TkTextEmbWinDisplayProc(chunkPtr, x, y, lineHeight, baseline, */ EmbWinBboxProc(chunkPtr, 0, screenY, lineHeight, baseline, &lineX, - &windowY, &width, &height); + &windowY, &width, &height); windowX = lineX - chunkPtr->x + x; - if (ewPtr->body.ew.textPtr->tkwin == Tk_Parent(tkwin)) { + if (textPtr->tkwin == Tk_Parent(tkwin)) { if ((windowX != Tk_X(tkwin)) || (windowY != Tk_Y(tkwin)) || (Tk_ReqWidth(tkwin) != Tk_Width(tkwin)) || (height != Tk_Height(tkwin))) { @@ -905,8 +908,8 @@ TkTextEmbWinDisplayProc(chunkPtr, x, y, lineHeight, baseline, } Tk_MapWindow(tkwin); } else { - Tk_MaintainGeometry(tkwin, ewPtr->body.ew.textPtr->tkwin, - windowX, windowY, width, height); + Tk_MaintainGeometry(tkwin, textPtr->tkwin, + windowX, windowY, width, height); } /* |