canvas::track::lines(3tk)

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

✨ 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