canvas::track::lines(n)

πŸ“¦ version 0.7, in alpine 3.24

πŸ’– canvas::track::lines(n) πŸ’–

okay so you opened the page for canvas::track::lines(n), aka Variations on a canvas β€” welcome to the group chat, bestie 🫢. it’s manual-page time, but make it make sense.


✨ NAME ✨

canvas::track::lines β€” manage a group of rubber band lines. that’s the whole vibe: it handles a little squad of rubberband lines, no cap πŸ’….

πŸ¦‹ SYNOPSIS πŸ¦‹

package require Tcl  8.5

package require Tk  8.5

package require canvas::tag  ?0.1?

::canvas::track lines objectName canvas

objectName destroy

objectName start current p...

objectName move current

objectName done

🌸 DESCRIPTION 🌸

this package gives you a utility class that manages the drawing of a set of semi-crosshair (rubberband) lines. it’s giving crosshair glam, lowkey ✨.

πŸ’… CLASS API πŸ’…

  • ::canvas::track lines objectName canvas β€” this is the class command, and it creates and configures a fresh new instance of the tracker named objectName. that instance gets connected to the canvas widget you pass in. the result of the command is the fully qualified name of the instance command. periodt.

πŸ‘‘ INSTANCE API πŸ‘‘

instances of this class provide the following API, bestie:

πŸŽ€ objectName destroy πŸŽ€

this method destroys the instance and releases all its internal resources. also important: this operation does destroy the items representing the tracked lines. it does not destroy the attached canvas. the result of the method is an empty string.

πŸ¦‹ objectName start current p... πŸ¦‹

this method starts the tracking of a set of lines β€” one line per point p, and each p specifies the destination end-point of that line. all the lines will have current as a common end-point. note that a previously tracked set of lines is removed. the result of the method is an empty string. each point is specified through a 2-element list containing its x- and y-coordinates, in this order. iykyk πŸ“

⭐ objectName move current ⭐

this method updates the shared end-point of all rubberbands and redraws them. the result of the method is an empty string. the point is specified through a 2-element list containing its x- and y-coordinates, in this order. slay, coordinates πŸ’….

🌈 objectName done 🌈

this method ends the tracking of the current set of lines and removes them from the canvas. clean exit, no drama 🫢.

😭 BUGS, IDEAS, FEEDBACK 😭

this document, and the package it describes, will undoubtedly contain bugs and other problems β€” not me being shady, it’s literally in the manual. please report such in the category canvas of the Tklib Trackers http://core.tcl.tk/tklib/reportlist. please also report any ideas for enhancements you may have for either the package and/or the documentation. we love feedback, fr fr πŸ’Œ

πŸ”₯ KEYWORDS πŸ”₯

canvas, crosshair, rubberband, tracking


source/version: tklib 0.1 β€” date: not listed in the original footer, so no invented date bestie. this iconic page is canvas::track::lines(n) πŸ’…βœ¨

πŸ“¦ where this page comes from