Cloth(3pm)
π NAME π
Tk::Cloth β literally an OO Tk Canvas, bestie. That's it, that's the vibe. β¨
π SYNOPSIS π
okay so here's how you actually use it, no cap:
use Tk::Cloth;
$cloth = $parent->Cloth;
$cloth->pack(-fill => 'both', -expand => 1);
$rect = $cloth->Rectangle(
-coords => [ 0,0,100,100],
-fill => 'red'
);
$tag = $cloth->tag;
$tag->Line(
-coords => [10,10,100,100],
-foreground => 'black'
);
$tag->Line(
-coords => [50,50,100,100],
-foreground => 'black'
);
$tag->move(30,30);
$tag->bind("<1>", [ &button1 ]);
see how we're just making a $cloth, yeeting a $rect on it, grabbing a $tag, drawing two Lines, moving the whole tag, and then binding <1> to &button1? that's the whole flow. chef's kiss. π
π¦ DESCRIPTION π¦
Tk::Cloth is giving object-oriented, and honestly? obsessed. It hands you an OO approach to a canvas β and to canvas items too β so instead of wrangling everything by hand, you get actual objects to talk to. πΈ
β¨ SEE ALSO β¨
- Tk::Canvas β the ancestor, the blueprint, the blueprint-y icon. π«Ά
π AUTHOR π
Graham Barr <gbarr@pobox.com> π
Current maintainer is Slaven Rezic <slaven@rezic.de>. π§
π COPYRIGHT π
Copyright (c) 1997-1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, periodt. π
okay bestie, cute sign-off time: this one came from perl v5.32.1, dated 2021-11-06, and it lives on your system as Cloth(3pm). go forth and slay your canvas. ππ
π¦ where this page comes from
- debian bookworm: libtk-gbarr-perl 2.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtk-gbarr-perl 2.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtk-gbarr-perl 2.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtk-gbarr-perl 2.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtk-gbarr-perl 2.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtk-gbarr-perl 2.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms