Author: Francois Vogel <[email protected]> State: Final Type: Project Vote: Done Created: 10-Feb-2020 Post-History: Keywords: Tk canvas Tcl-Version: 8.7 Tcl-Branch: bug-3552805fff
This TIP proposes to let the .canvas raise and .canvas lower do nothing gracefully when receiving non-existing tagOrIds respectively as "aboveThis" and "belowThis" argument.
Ticket 3437816fff pointed out that .canvas raise $tagOrId1 $tagOrId2 and .canvas lower $tagOrId1 $tagOrId2 were not symmetrical in their error cases management: the former returned an error when $tagOrId2 does not exist, but the latter did not. This was fixed in 2011 by making the latter return the same error as the former.
In the wake of the "Do nothing gracefully" reform, aka TIP #323, the present TIP proposes to remove the error when calling .canvas raise/lower with a non-existent "aboveThis"/"belowThis" tag.
Note that the current behavior is inconsistent anyway:
package require Tk .c create line 0 0 10 10 -tags aline # inconsistent error spitting .c lower aline noline ; # error: tagOrId "noline" doesn't match any items .c lower bline aline ; # no error # ditto for raise instead of lower: .c raise aline noline ; # error: tagOrId "noline" doesn't match any items .c raise bline aline ; # no error
With the present TIP implemented, no error would be raised for any of the four above lines.
This branch targets 8.7.
This document has been placed in the public domain.