#
# return a sorted list of available icons with a name matching search pattern
#
proc findIcon {pattern} {
# load list of available icons
set contexts [gnocl::icon contexts]
foreach context $contexts {
lappend ICONS $context [lsort [gnocl::icon icons -context $context]]
}
foreach {k v} $ICONS {
foreach i [lsearch -all -glob $v $pattern ] {
lappend res [lindex $v $i]
}
}
return [lsort $res]
}
Comments