TIP 574: Add a 'tag delete' command to the ttk::treeview widget

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Author:         Emiliano Gavilan <[email protected]>, Francois Vogel <[email protected]>
State:          Final
Type:           Project
Vote:           Done
Created:        8-May-2020
Post-History:   
Keywords:       Tk Ttk treeview tag
Tcl-Version:    8.7
Tk-Branch:      tip-574
Tk-Branch:      bug-1bb2f1d7ab
Vote-Summary:   Accepted 7/0/0
Votes-For:      MC, JD, DKF, BG, KBK, SL, FV
Votes-Present:  none
Votes-Against:  none

Abstract

This TIP proposes to add a subcommand to the treeview widget tag command so that the user can delete tags.

Rationale

The ttk::treeview widget features a tag remove command, which removes a tag from one or more treeview items. After tag removal from an item, the tag information is still available, which is desirable to be able to use this tag with other items, and/or to use it again later.

There is currently no way to completely delete a tag from a ttk::treview widget. This TIP proposes to add such a feature. The text widget does the same thing by providing two separate tag delete and tag remove subcommands.

Specification

A new subcommand tag delete tagName is added. It deletes all tag information for the tagName argument. The command removes the tag from all items in the widget and also deletes any other information associated with the tag, such as bindings and display information. The command returns an empty string.

Implementation

See the bug-1bb2f1d7ab branch, aka tip-574.

This branch targets 8.7.

References

See also ticket 1bb2f1d7ab.

Copyright

This document has been placed in the public domain.