canvasLabel3tk
Tkpiechart canvas label class
Usage
package require stooop 4.1
package require switched 2.2
package require tkpiechart 6.6
stooop::new canvasLabel canvas ?options?
switched::configure canvasLabelObject ?options?
switched::cget canvasLabelObject option
stooop::delete canvasLabelObject
Overview
The canvasLabel class brings some Tk label widget functionality to the canvas text item, such as a background and a border.
The canvasLabel is built with a bullet rectangle on the left side of the text. The relief changes according to the select state, with a traditionally sunken relief when selected.
The label has a specific tag, which can be used to retrieve the coordinates of the object or move it, thanks to the canvas facilities.
stooop::newcanvasLabelcanvas ?options?-
Creates a canvasLabel object in the specified Tk canvas. The canvasLabel object identifier is returned (referred to as canvasLabelObject in this document).
switched::configurecanvasLabelObject ?options?-
Configures a canvasLabel object or returns all the options with their current values if no options are passed as parameters.
switched::cgetcanvasLabelObject option-
Returns an option value for the specified canvasLabel object.
stooop::deletecanvasLabelObject-
Deletes the specified canvasLabel object.
Options
-
-anchor value -
Specifies the anchor position of the rectangle and the text, relative to the positioning point. The behavior is similar to the
-anchoroption of thecanvastext item, except that the rectangle is taken into account. The default is center.
-
-background color -
Specifies the background color of the bullet rectangle, as in the
-filloption of thecanvasrectangle item. The default is transparent (empty string).
-
-bordercolor color -
Specifies the border color of the rectangle, as in the
-outlineoption of thecanvasrectangle item. The default is black.
-
-borderwidth value -
Specifies the border width of the rectangle, as in the
-widthoption of thecanvasrectangle item. By default, the width is 1 pixel, which is the minimum width.
-
-bulletwidth value -
Specifies the width of the rectangle placed to the left of the text. Defaults to 10.
-
-font value -
Specifies the font of the text, as in the
-fontoption of thecanvastext item. The default is system dependent.
-
-foreground color -
Specifies the color of the text, as in the
-filloption of thecanvastext item. The default is black.
-
-justify value -
Specifies how to justify the text, as in the
-justifyoption of thecanvastext item. The default is left.
-
-minimumwidth value -
The total label width will not go below the specified value, but may be larger if the label text requires it.
-
-padding value -
Specifies how much space to leave between the text and the closest rectangle edge. Units are identical to those specified in the
canvasCOORDINATES manual section.
-
-scale list -
List of 2 floating point numbers used to set the scaling factor in the x and y axis. Scaling is applied immediately and defaults to 1.
-
-select boolean -
Sets the label state.
-
-selectrelief value -
Either flat, raised or sunken. Specifies the 3D effect desired for the text area when the label is selected.
-
-stipple bitmap -
Specifies the stipple pattern filling the rectangle, as in the
-stippleoption of thecanvasrectangle item. There is no bitmap by default.
-
-text text -
Specifies the string to be displayed in the text area, as in the
-textoption of thecanvastext item. The default is an empty string.
-
-textbackground color -
Specifies the color of the text area background.
-
-width value -
Specifies a maximum line length for the text, as in the
-widthoption of thecanvastext item. The default is 0.
Tags
The labeler has the following specific tag (see the canvas manual page ITEM IDS AND TAGS section for more information):
- •
-
canvasLabel(canvasLabelObject)
Bugs, ideas, feedback
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tkpiechart of the Tklib Trackers [http://core.tcl.tk/tklib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation.
Keywords
canvas, labeler, pie, slice
Releases
9 releases since Debian 5.0 (Lenny); the text changed 5 times.