canvas::track::lines(3tk)
β¨ NAME β¨
canvas::track::lines β the girl who manages a whole squad of rubber band lines π
So like, welcome to canvas::track::lines(3tk), from the Variations on a canvas corner of the world. Sit down bestie, we're doing crosshairs. π
πΈ 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 π¦
Okay so this package is literally a whole utility class whose entire job is managing the drawing of a set of semi-crosshair (rubberband) lines. That's it. That's the gig. And it ate. β¨
π CLASS API π
::canvas::track lines objectName canvas
This right here is the class command, and it's the moment of creation: it makes a brand-new instance of the tracker and configures it, and you get to name her objectName. She's gonna be connected to the canvas widget you hand over as canvas. Iconic pairing, no notes. π«Ά
The result of the command is the fully qualified name of the instance command. Keep it, you'll need it, iykyk.
π INSTANCE API π
So once you've got an instance, she comes with this whole API. Main character energy only:
objectName destroy
This method destroys the instance and releases all her internal resources. She's gone, she said goodbye, periodt. π
Heads up: this operation does destroy the items representing the tracked lines. It does not destroy the attached canvas. The canvas lives on, unbothered, moisturised, in her lane. π
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 each line. Every single line will have current as a common end-point, like they're all holding hands. π«Ά
Ngl: a previously tracked set of lines is removed. Not archived. Not saved. 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. x first, y second, do not flip them, I'm begging. π
objectName move current
This method updates the shared end-point of all the rubberbands and redraws them. Glow-up in real time, honestly. β¨
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. Same deal: x, then y. π
objectName done
This method ends the tracking of the current set of lines and removes them from the canvas. That's a wrap, bestie. π
π BUGS, IDEAS, FEEDBACK π
Okay so real talk: this document, and the package it describes, will undoubtedly contain bugs and other problems. It's giving "we know". π
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 want the ideas, we want the docs glow-up, we want all of it. π«Ά
π₯ KEYWORDS π₯
canvas, crosshair, rubberband, tracking
And that's the whole page, babe. This beauty comes to you from tklib, version 0.1, dated the day it was dated β shoutout to the canvas::track::lines(3tk) manual page herself. Go forth and draw some rubberbands. πβ¨ππ¦πΈ
π¦ where this page comes from
- debian trixie: tklib 0.9-1
- ubuntu questing: tklib 0.9-1
- ubuntu resolute: tklib 0.9-1build1
- ubuntu stonking: tklib 0.9-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms