canvasLabel(n)
π canvasLabel(n) β bestie, it's the canvasLabel class π
okay so real quick: this is the canvasLabel man page from the canvasLabel class section, and it's literally the girlypop of Tk canvas text items. let's get into it π
β¨ NAME β¨
canvasLabel β tkpiechart canvas label class. yes queen, that's the whole name. short, iconic, done. π
π¦ SYNOPSIS π¦
first up, the packages you gotta require (no cap, you need all three):
package require stooop 4.1
package require switched 2.2
package require tkpiechart 6.6
then the actual moves:
stooop::new canvasLabel canvas ?options?
switched::configure canvasLabelObject ?options?
switched::cget canvasLabelObject option
stooop::delete canvasLabelObject
πΈ DESCRIPTION πΈ
so the canvasLabel class is out here bringing some of that Tk label widget functionality to the canvas text item β think background, think border. it's giving label but make it canvas β¨
the canvasLabel is built with a bullet rectangle sitting on the left side of the text. the relief changes according to the select state, and when it's selected you get that traditionally sunken relief. lowkey obsessed with the commitment to the aesthetic π
the label has a specific tag, which you can use to retrieve the coordinates of the object or move it β thanks to the canvas facilities. iykyk. π«Ά
stooop::new canvasLabel canvas ?options? creates a canvasLabel object in the specified Tk canvas. the canvasLabel object identifier gets returned β and this doc refers to that as canvasLabelObject, so keep that name in your head bestie π
switched::configure canvasLabelObject ?options? configures a canvasLabel object. or, if you don't pass any options as parameters, it returns all the options with their current values. two-for-one behavior, we love a flexible icon π
switched::cget canvasLabelObject option returns an option value for the specified canvasLabel object. that's it. that's the whole thing. π
stooop::delete canvasLabelObject deletes the specified canvasLabel object. bye bestie ππ
β¨ OPTIONS β¨
every single one, in order, no skipping, we're thorough in this house π§
-anchorvalue β specifies the anchor position of the rectangle and the text, relative to the positioning point. behavior is similar to the-anchoroption of the canvas text item, except that the rectangle is taken into account. default iscenter. π―-backgroundcolor β specifies the background color of the bullet rectangle, as in the-filloption of the canvas rectangle item. default is transparent (that's the empty string, for the record). π«§-bordercolorcolor β specifies the border color of the rectangle, as in the-outlineoption of the canvas rectangle item. default isblack. π€-borderwidthvalue β specifies the border width of the rectangle, as in the-widthoption of the canvas rectangle item. by default, the width is 1 pixel, which is the minimum width. tiny but fierce π-bulletwidthvalue β specifies the width of the rectangle placed to the left of the text. defaults to 10. π-fontvalue β specifies the font of the text, as in the-fontoption of the canvas text item. the default is system dependent, so it's a mystery until you look. π-foregroundcolor β specifies the color of the text, as in the-filloption of the canvas text item. default isblack. β¨-justifyvalue β specifies how to justify the text, as in the-justifyoption of the canvas text item. default isleft. π-minimumwidthvalue β the total label width will not go below the specified value, but may be larger if the label text requires it. so it's a floor, not a ceiling, bestie π§±-paddingvalue β specifies how much space to leave between the text and the closest rectangle edge. units are identical to those specified in the canvasCOORDINATESmanual section. personal space matters π-scalelist β 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. immediate, like your texts back π¦-selectboolean β sets the label state. that's it, that's the description π-selectreliefvalue β eitherflat,raisedorsunken. specifies the 3D effect desired for the text area when the label is selected. pick your vibe π₯-stipplebitmap β specifies the stipple pattern filling the rectangle, as in the-stippleoption of the canvas rectangle item. there is no bitmap by default. texture optional π-texttext β specifies the string to be displayed in the text area, as in the-textoption of the canvas text item. default is an empty string (sad, but valid) π-textbackgroundcolor β specifies the color of the text area background. yes, separate from-background, they're different things, don't @ me πΈ-widthvalue β specifies a maximum line length for the text, as in the-widthoption of the canvas text item. default is0. π
π·οΈ TAGS π·οΈ
the labeler has the following specific tag β peep the canvas manual page ITEM IDS AND TAGS section for more info, fr fr:
canvasLabel(canvasLabelObject)
that's the one. memorize it. π
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. like, they said it themselves, no cap.
please report such in the category tkpiechart of the Tklib Trackers at [http://core.tcl.tk/tklib/reportlist]. and please also report any ideas for enhancements you may have for either the package and/or the documentation β they want the feedback, bestie, give them the feedback π«Ά
π SEE ALSO π
piepieBoxLabelerpiePeripheralLabeler
go read those too, they're the extended universe β
π KEYWORDS π
canvas, labeler, pie, slice β the whole aesthetic in four words β¨
π COPYRIGHT π
Copyright (c) 1995-2004 Jean-Luc Fontaine <jfontain@free.fr>
respect the legend π«‘
and that's the whole page, bestie!! this was canvasLabel(n), canvasLabel class, from tklib version 6.6, and we are DONE. mwah πππ
π¦ where this page comes from
- alpine 3.24: tk-lib-doc 0.7-r0 Β· TCL
- Copyright (c) 1995-2004 Jean-Luc Fontaine <jfontain@free\&.fr>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms