File List
Not logged in

The union of all files from all check-ins in directory assets/materialicons0.1   [history]

MaterialIcons 0.1

A Tcl/Tk package wrapping the Material Design Icons.




package require Tk
package require tdom
package require tksvg


package require MaterialIcons
MaterialIcons names
MaterialIcons svg name ?color?
MaterialIcons image name ?size? ?color?
MaterialIcons flush
MaterialIcons rebuild

Method names returns an alphabetically sorted list of all icon names.

Method svg returns an SVG string for the icon name with optional fill color color (defaults to black).

Method image creates and returns a photo image for the icon name with optional fill color color. The size option specifies the integer icon size. If it is negative, the size is in pixels, otherwise in points. The default value for size is 16 points. The photo image is kept in an image cache for later re-use.

Method flush deletes all cached icon photo images.

Method rebuild recreates all cached icon photo images which have a size in points. This is useful when the tk scaling factor is changed at runtime.

A utility script named show.tcl demonstrates the usage of this package and displays all icons in a canvas widget.