#578 Use of deprecated functions in tkGrid.c

obsolete: 8.1
closed-fixed
nobody
49. [grid] (33)
2
2001-04-04
2000-10-31
No

OriginalBugID: 2080 Bug
Version: 8.1
SubmitDate: '1999-05-17'
LastModified: '1999-06-30'
Severity: LOW
Status: Released
Submitter: pat
ChangedBy: redman
OS: Linux
OSVersion: 4.2
Machine: Other
FixedDate: '1999-06-30'
FixedInVersion: 8.2b1

Name:

Jan Nijtmans

Comments:

I checked all of Tk for any use of this group of deprecated functions

and symbols. tkGrid.c was the only one reported.

ObservedBehavior:

In tkGrid.c the functions Tk_CancelIdleCall() and Tk_EventuallyFree()

are used, which are deprecated. Lucky enough, tk.h contains macros

which do the conversion, still it is bad style.

Patch:

*** generic/tkGrid.c.orig Thu Apr 29 21:37:52 1999

--- generic/tkGrid.c Sat May 15 18:26:16 1999

***************

*** 435,441 ****

slavePtr->iPadX = slavePtr->iPadY = 0;

slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;

if (slavePtr->flags & REQUESTED_RELAYOUT) {

! Tk_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr);

}

slavePtr->flags = 0;

slavePtr->sticky = 0;

--- 435,441 ----

slavePtr->iPadX = slavePtr->iPadY = 0;

slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;

if (slavePtr->flags & REQUESTED_RELAYOUT) {

! Tcl_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr);

}

slavePtr->flags = 0;

slavePtr->sticky = 0;

***************

*** 522,528 ****

*/

while (masterPtr->flags & REQUESTED_RELAYOUT) {

! Tk_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr);

ArrangeGrid ((ClientData) masterPtr);

}

SetGridSize(masterPtr);

--- 522,528 ----

*/

while (masterPtr->flags & REQUESTED_RELAYOUT) {

! Tcl_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr);

ArrangeGrid ((ClientData) masterPtr);

}

SetGridSize(masterPtr);

***************

*** 2007,2013 ****

*

* DestroyGrid --

*

! * This procedure is invoked by Tk_EventuallyFree or Tcl_Release

* to clean up the internal structure of a grid at a safe time

* (when no-one is using it anymore). Cleaning up the grid involves

* freeing the main structure for all windows. and the master structure

--- 2007,2013 ----

*

* DestroyGrid --

*

! * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release

* to clean up the internal structure of a grid at a safe time

* (when no-one is using it anymore). Cleaning up the grid involves

* freeing the main structure for all windows. and the master structure

***************

*** 2097,2106 ****

Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->gridHashTable,

(char *) gridPtr->tkwin));

if (gridPtr->flags & REQUESTED_RELAYOUT) {

! Tk_CancelIdleCall(ArrangeGrid, (ClientData) gridPtr);

}

gridPtr->tkwin = NULL;

! Tk_EventuallyFree((ClientData) gridPtr, DestroyGrid);

} else if (eventPtr->type == MapNotify) {

if (!(gridPtr->flags & REQUESTED_RELAYOUT)) {

gridPtr->flags |= REQUESTED_RELAYOUT;

--- 2097,2106 ----

Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->gridHashTable,

(char *) gridPtr->tkwin));

if (gridPtr->flags & REQUESTED_RELAYOUT) {

! Tcl_CancelIdleCall(ArrangeGrid, (ClientData) gridPtr);

}

gridPtr->tkwin = NULL;

! Tcl_EventuallyFree((ClientData) gridPtr, DestroyGrid);

} else if (eventPtr->type == MapNotify) {

if (!(gridPtr->flags & REQUESTED_RELAYOUT)) {

gridPtr->flags |= REQUESTED_RELAYOUT;

PatchFiles:

tkGrid.c

Applied the patch.

-- 06/30/1999 redman

Discussion

  • Brent B. Welch

    Brent B. Welch - 2000-10-31
    • priority: 5 --> 2
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2001-04-04
    • labels: 104343 --> 49. [grid]
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks