canvasLabel(n)

πŸ“¦
version 0.7 Β· 3 versions
, in alpine 3.24

πŸ’… 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 🧚

  • -anchor value β€” specifies the anchor position of the rectangle and the text, relative to the positioning point. behavior is similar to the -anchor option of the canvas text item, except that the rectangle is taken into account. default is center. 🎯
  • -background color β€” specifies the background color of the bullet rectangle, as in the -fill option of the canvas rectangle item. default is transparent (that's the empty string, for the record). 🫧
  • -bordercolor color β€” specifies the border color of the rectangle, as in the -outline option of the canvas rectangle item. default is black. πŸ–€
  • -borderwidth value β€” specifies the border width of the rectangle, as in the -width option of the canvas rectangle item. by default, the width is 1 pixel, which is the minimum width. tiny but fierce πŸ’€
  • -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 -font option of the canvas text item. the default is system dependent, so it's a mystery until you look. πŸ™ˆ
  • -foreground color β€” specifies the color of the text, as in the -fill option of the canvas text item. default is black. ✨
  • -justify value β€” specifies how to justify the text, as in the -justify option of the canvas text item. 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. so it's a floor, not a ceiling, bestie 🧱
  • -padding value β€” specifies how much space to leave between the text and the closest rectangle edge. units are identical to those specified in the canvas COORDINATES manual section. personal space matters πŸ’œ
  • -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. immediate, like your texts back πŸ¦‹
  • -select boolean β€” sets the label state. that's it, that's the description πŸ‘‘
  • -selectrelief value β€” either flat, raised or sunken. specifies the 3D effect desired for the text area when the label is selected. pick your vibe πŸ”₯
  • -stipple bitmap β€” specifies the stipple pattern filling the rectangle, as in the -stipple option of the canvas rectangle item. there is no bitmap by default. texture optional πŸŽ€
  • -text text β€” specifies the string to be displayed in the text area, as in the -text option of the canvas text item. default is an empty string (sad, but valid) 😭
  • -textbackground color β€” specifies the color of the text area background. yes, separate from -background, they're different things, don't @ me 🌸
  • -width value β€” specifies a maximum line length for the text, as in the -width option of the canvas text item. default is 0. πŸ“

🏷️ 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 🌈

  • pie
  • pieBoxLabeler
  • piePeripheralLabeler

go read those too, they're the extended universe ⭐


πŸ”‘ KEYWORDS πŸ”‘

canvas, labeler, pie, slice β€” the whole aesthetic in four words ✨


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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms