Tk Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Ticket UUID: 3552805
Title: Make ".canvas lower" work with non-existent belowThis tag
Type: RFE Version: None
Submitter: stevenaaus Created on: 2012-07-31 21:54:32
Subsystem: 05. Canvas Items Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2020-02-22 15:39:11
Resolution: Fixed Closed By: fvogel
    Closed on: 2020-02-22 15:39:11
Description:
This is new behaviour, and i ~think~ is probably a bug.

If the "belowThis" tag is not defined, wish throws an error.
All previous version os wish this does not happen.

pack [canvas .c]
.c create line 0 0 10 10 -tags aline
.c lower aline noline

> tag "noline" doesn't match any items
User Comments: fvogel added on 2020-02-22 15:39:11:
Merged to trunk, following acceptation of the TIP by the TCT.

fvogel added on 2020-02-10 21:45:17: (text/x-fossil-wiki)
I have created [http://core.tcl-lang.org/tips/doc/trunk/tip/565.md|TIP #565] to gather further comments on this.

fvogel added on 2019-12-25 17:00:45: (text/x-fossil-wiki)
I understand what was done in [3437816fff]: symmetry between the error-spitting <code>.canvas raise</code> command and the non-error-spitting <code>.canvas lower</code> was restored so that both spit the same error. Yes this was a bugfix, and the reasons for having done so are explained in that ticket.

That said, in the wake of the "Do nothing gracefully" reform, aka [https://core.tcl-lang.org/tips/doc/trunk/tip/323.md|TIP #323], I think we could indeed remove the error when calling <code>.canvas raise|lower</code> with a non-existent "aboveThis"|"belowThis" tag.

Especially since the error spitting is currently inconsistent:
<verbatim>
package require Tk
.c create line 0 0 10 10 -tags aline

# inconsistent error spitting
.c lower aline noline   ; # tagOrId "noline" doesn't match any items
.c lower bline aline    ; # no error

# ditto for raise instead of lower:
.c raise aline noline   ; # tagOrId "noline" doesn't match any items
.c raise bline aline    ; # no error
</verbatim>

We would do this in 8.7 and not in 8.6. Would need a small TIP I guess.

Comments?

stevenaaus added on 2012-10-28 03:24:12:
The issue is <b>Many</b> tk apps are now going to needlessly start throwing errors.
My tkspider game does just this. (screenshot attached).

There is no real plus side to this change.

stevenaaus added on 2012-10-28 03:22:18:
File Added - 455554: a6.png

stevenaaus added on 2012-08-01 15:55:13:
I't be nice to not throw an error here (and also modify the raise command's behaviour)
* AFAIK - all other references to  non-existing tags do not throw errors
* This is the way it has been with "lower" for a long time.

dkf added on 2012-08-01 15:50:18:
No, it's a FRQ

dkf added on 2012-08-01 15:48:44:
allow_comments - 0



data_type - 362997

nijtmans added on 2012-08-01 05:08:07:
allow_comments - 1

No, it's a bug fix: See #3437816

Attachments: