canvasLabel(3tk)

πŸ“¦
version 0.9 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– canvasLabel(3tk) β€” the manual page but make it a group chat πŸ’–

okay so bestie, you opened the canvasLabel(3tk) page and honestly? it's giving "tiny widget, big personality." let's get into it, no cap. πŸŽ€


✨ NAME ✨

canvasLabel β€” the tkpiechart canvas label class. that's it, that's the whole name section, she's concise and she's iconic. πŸ’…


🌸 SYNOPSIS 🌸

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

like yes, you need stooop 4.1, switched 2.2 and tkpiechart 6.6 first. prerequisites, babe. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the canvasLabel class literally brings some Tk label widget functionality over to the canvas text item β€” we're talking a background and a border, the glow-up essentials. ✨

the canvasLabel is built with a bullet rectangle on the left side of the text. the relief changes according to the select state, and when it's selected it gets a traditionally sunken relief. it's giving "pressed and proud." πŸ’…

and 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. main character energy, honestly. πŸ‘‘


🌈 the four calls you'll be doing

stooop::new canvasLabel canvas ?options?

Creates a canvasLabel object in the specified Tk canvas. The canvasLabel object identifier is returned β€” and that's what this whole document calls canvasLabelObject. remember that name, she comes up a lot. πŸ“›

switched::configure canvasLabelObject ?options?

Configures a canvasLabel object, or returns all the options with their current values if you don't pass any options as parameters. no options? she just tells you everything. oversharing queen. πŸ™ˆ

switched::cget canvasLabelObject option

Returns an option value for the specified canvasLabel object. one option, one answer. πŸ“

stooop::delete canvasLabelObject

Deletes the specified canvasLabel object. bye bestie πŸ‘‹πŸ˜­


πŸ‘‘ OPTIONS πŸ‘‘

okay here's the full roster, all 17 of them, no skipping, we do not leave anyone on read:

  • -anchor value β€” Specifies the anchor position of the rectangle and the text, relative to the positioning point. The behavior is similar to the -anchor option of the canvas text 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 -fill option of the canvas rectangle item. The default is transparent (that's an empty string, fr). πŸ«₯
  • -bordercolor color β€” Specifies the border color of the rectangle, as in the -outline option of the canvas rectangle item. The 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. no thinner than that, bestie. πŸ“
  • -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 like, whatever your machine woke up feeling today. πŸ’…
  • -foreground color β€” Specifies the color of the text, as in the -fill option of the canvas text item. The default is black. πŸ–€
  • -justify value β€” Specifies how to justify the text, as in the -justify option of the canvas text 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. so it's a floor, not a ceiling. 🧱
  • -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. πŸ“
  • -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 -stipple option of the canvas rectangle item. There is no bitmap by default. πŸ•³οΈ
  • -text text β€” Specifies the string to be displayed in the text area, as in the -text option of the canvas text 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 -width option of the canvas text 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 info, iykyk:

  • canvasLabel(canvasLabelObject)

πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. it's not a vibe, it's just true. 😭

Please report such in the category tkpiechart of the Tklib Trackers at http://core.tcl.tk/tklib/reportlist.

Please also report any ideas for enhancements you may have for either package and/or documentation. we love a suggestion box moment. πŸ’Œ


πŸ” SEE ALSO πŸ”

  • pie
  • pieBoxLabeler
  • piePeripheralLabeler

πŸ”‘ KEYWORDS πŸ”‘

canvas, labeler, pie, slice


Copyright (c) 1995-2004 Jean-Luc Fontaine <jfontain@free.fr>


and that's the whole page bestie, you ate it. 🫢 this was tklib version 6.6 β€” go forth and label your canvases, periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from