TIP 704: extend Tk_CanvasTextInfo

Login
Author:         Jan Nijtmans <[email protected]>
State:          Draft
Type:           Project
Tcl-Version:    9.1
Tk-Branch:      tip-704

Abstract

This TIP proposes to extend Tk_CanvasTextInfo with three new fields. It allows Textual canvas items to retrieve information independent from scaling.

Type managers should treat the new fields of the Tk_CanvasTextInfo structure as read-only.

Rationale

The Tk_CanvasTextInfo structure has 3 integer fields which store pixel information. Those are:

* int selBorderWidth
* int insertWidth
* int insertBorderWidth

Those 3 fields correspond with the -selectborderwidth, -insertwidth and -insertborderwidth canvas widget options. Those options accept forms like "10p", and those are not reparsed when the scaling factor changes. That means, type managers using those values might display the canvas item with the wrong widths.

Specification

Three new fields are added to the structure. Since those fields were already reserved in Tk 9.0, this is not a binary incompatibility. The new fields are:

* Tcl_Obj *insertBorderWidthObj
* Tcl_Obj *insertWidthObj
* Tcl_Obj *selBorderWidthObj

The contain the same information as the three integer fields, only they will provide the correct information despite of scaling changes.

The 3 integer fields are deprecated, starting with Tk 9.1. They won't be removed in any Tk 9.x release, since that would create a binary incompatibility.

Implementation

See the tip-704 branch.

Copyright

This document has been placed in the public domain.