FamFamFam Demo

Keith Vetter 2019-01-03: I've always appreciated the FamFamFam icon set--it's nice to have a royalty-free set of icons to quickly pick from. I also think they're under-appreciated.

One problem is that there are over 1,000 icons in icon set and it's hard to know what's in there. To help fix that, here's a little program that displays all the FamFamFam icons in the four icon sets. You can hover over any icon and a tooltip will pop up with the name of the icon.

famfamfam_demo_screenshot

##+##########################################################################
#
# famfamfam.tcl -- Display all the icons in the famfamfam icon set
# by Keith Vetter 2019-01-03
#

package require Tk
package require famfamfam
package require famfamfam::flags
package require famfamfam::mini
package require famfamfam::mint
package require famfamfam::silk
package require tooltip

proc ShowIconSet {frame iset} {
    set names [lsort [::famfamfam::$iset list]]
    set numCols [expr {round(sqrt([llength $names]))}]
    label $frame.title -text "[llength $names] icons in $iset" -font {Helvetica 18 bold}
    grid $frame.title -row 0 -column 0 -columnspan $numCols

    set row 1
    set col 0
    foreach name $names {
        set w "$frame.$name"
        label $w -image [::famfamfam::$iset get $name]
        bind $w <Enter> [list ShowCommand $iset $name]
        tooltip::tooltip $w $name
        grid $w -row $row -column $col
        incr col
        if {$col >= $numCols} {
            set col 0
            incr row
        }
    }
}

proc ShowCommand {iset name} {
    set ::S(tooltip) "famfamfam::$iset get $name"
}

wm title . "famfamfam icon sets"
grid [frame .flags -bd 1 -relief solid] -row 0 -column 0 -sticky news
ShowIconSet .flags flags
grid [frame .mini -bd 1 -relief solid] -row 0 -column 1 -sticky news
ShowIconSet .mini mini
grid [frame .mint -bd 1 -relief solid] -row 0 -column 2 -sticky news
ShowIconSet .mint mint
update
grid [frame .silk -bd 1 -relief solid] -row 1 -column 0 -columnspan 3 -sticky news
grid [frame .silk.inner]
grid anchor .silk c
ShowIconSet .silk.inner silk
label .tooltip -textvariable S(tooltip)
grid .tooltip -row 2 -column 0 -columnspan 3

return