Tk Source Code

View Ticket
Login
Ticket UUID: 220351
Title: Fix wm frame on Windows
Type: Bug Version: obsolete: 8.0p2
Submitter: welch Created on: 2000-10-31 23:17:04
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 08:55:27
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-23 01:55:27
Description:
OriginalBugID: 589 Bug
Version: 8.0p2
SubmitDate: '1998-05-21'
LastModified: '1998-08-05'
Severity: LOW
Status: Released
Submitter: stanton
ChangedBy: stanton
OS: All Windows
OSVersion: NA
Machine: NA
FixedInVersion: 8.0.3
ClosedDate: '1998-08-05'


On Windows, using tk8.0p2, if you call wm frame immediately after

creating a window, you are liable to get a segmentation violation.

The Tk code does not check whether a window exists before getting the

window identifier.



The appended patch fixes this problem.  This patch appears to be

required in Tk8.1a2 as well.



Ian Taylor

[email protected]





*** /5g/ian/tk8.0p2/win/tkWinWm.c       Fri Oct 31 12:57:07 1997

--- tkWinWm.c   Wed Apr 15 15:58:45 1998

*************** Tk_WmCmd(clientData, interp, argc, argv)

*** 1354,1359 ****

--- 1354,1362 ----

                    argv[0], " frame window\"", (char *) NULL);

            return TCL_ERROR;

        }

+       if (Tk_WindowId((Tk_Window) winPtr) == None) {

+           Tk_MakeWindowExist((Tk_Window) winPtr);

+       }

        hwnd = wmPtr->wrapper;

        if (hwnd == NULL) {

            hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr));





applied patch 8/5/98 (SS)