Menu

#69 Feature to rearrange canvas items within a scroll command.

open
5
2003-11-13
2000-11-01
No

OriginalBugID: 3994 RFE
Version: 8.3b1
SubmitDate: '2000-01-10'
LastModified: '2000-01-25'
Severity: SER
Status: UnAssn
Submitter: techsupp
ChangedBy: hobbs
OS: All

Name:

Sebastian Wangnick

DesiredBehavior:

I manage a canvas where certain items are tagged as being window-relative, i.e., are located at, say, 60% of the canvas width and 5% of the canvas height. I wish to keep them at their position by intercepting the canvas xscrollcommand and yscrollcommand (which are guaranteed to be called whenever anything occurs that could change the display in a scrollbar, such as a change in the total size of the widget's contents).

However, with the current canvas implementation this leads to flicker because the scroll commands are called only AFTER the canvas has already been redrawn (with my window-relative items at the wrong position).

I therefore plea to move, within DisplayCanvas, the call to CanvasUpdateScrollbars from its position at the end of the procedure to the start, between the check for tkwin NULL and the check for Tk_IsMapped. This works excellent for me, and shouldn't really break anyones code.

Patch:

*** tkCanvas.c.orig Wed Dec 22 03:13:44 1999

--- tkCanvas.c Mon Jan 10 08:57:45 2000

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

*** 2210,2215 ****

--- 2210,2219 ----

return;

}

+ if (canvasPtr->flags & UPDATE_SCROLLBARS) {

+ CanvasUpdateScrollbars(canvasPtr);

+ }

+

if (!Tk_IsMapped(tkwin)) {

goto done;

}

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

*** 2405,2413 ****

canvasPtr->flags &= ~(REDRAW_PENDING|BBOX_NOT_EMPTY);

canvasPtr->redrawX1 = canvasPtr->redrawX2 = 0;

canvasPtr->redrawY1 = canvasPtr->redrawY2 = 0;

- if (canvasPtr->flags & UPDATE_SCROLLBARS) {

- CanvasUpdateScrollbars(canvasPtr);

- }

}

/*

--- 2409,2414 ----

PatchFiles:

tkCanvas.c

Discussion

  • Don Porter

    Don Porter - 2001-03-23
    • labels: 104332 -->
    • milestone: 102503 -->
     
  • Don Porter

    Don Porter - 2001-03-23
    • labels: --> 04. Canvas Basics
     
  • Don Porter

    Don Porter - 2003-11-13
    • assigned_to: nobody --> hobbs
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.