IconList(3pm)

πŸ’– IconList β€” Tk::IconList πŸ’–

okay bestie, so like… this is Tk::IconList, an icon list widget. it's a little canvas full of icons and labels and you get to click around in it. no cap, it's giving "file browser but make it a widget". πŸŽ€


✨ SYNOPSIS ✨

use Tk::IconList;
$il = $mw->IconList(-browsecmd => sub { ... },
                    -command   => sub { ... })->pack;
$il->Add($icon1, $text1);
$il->Add($icon2, $text2);
$il->Arrange;
...
$il->DeleteAll;

literally that's it. build it, add icons, arrange, go feral. πŸ¦‹


🌸 DESCRIPTION 🌸

πŸ‘‘ OPTIONS

  • -browsecmd β€” the browse callback, iykyk 🫢
  • -command β€” the main callback that fires when stuff happens
  • -font β€” the font, bestie πŸ’…
    • -item -foreground|-fg β€” the item foreground / -fg situation

🧚 METHODS

  • DeleteAll β€” deletes every single item inside the canvas subwidget AND resets the IconList's state. full clean slate energy. ✨
  • Add($image, $text) β€” adds an icon into the IconList with the designated image and text. drop it in, slay. πŸ“
  • Arrange β€” places the icons in a column-major arrangement. yes, column-major, we're being specific about it. πŸ’œ
  • Get β€” returns the selected item. that's the whole thing. it just tells you what's selected. πŸ‘‘
  • Invoke β€” gets called when the user invokes the IconList (usually by double-clicking or pressing the Return key). this one's an internal method, so like, it's not for you, bestie, it's for the widget itself. πŸ™ˆ
  • See($tag) β€” if the item is not (completely) visible, scroll the canvas so that it becomes visible. also an internal method ngl. 🌈

the original tkfbox.tcl from Tcl/Tk is:

Copyright (c) 1994-1996 Sun Microsystems, Inc.

see the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. (yes, ALL of them. read the file, bestie, it's important πŸ’€)

translated to Perl/Tk by Slaven Rezic <srezic@cpan.org>. iconic behavior honestly 🫢


πŸ”₯ SEE ALSO πŸ”₯

  • Tk::FBox β€” go look at it, it's right there πŸ’œ

and that's the whole page, periodt πŸ’… this lil doc is from perl v5.40.1, dated 2025-04-13. mwah, go build something cute with it βœ¨πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from