iconSVG Library - add icon

Brian Milby brian at milby7.com
Wed Dec 27 20:57:25 EST 2017


Someone mentioned a desire to use custom icons in several of the widgets
included with the later versions of LiveCode.  Currently they all can only
be set to use icons sourced from the iconSVG library.  Rather than
adjusting all of them to handle arbitrary SVG, I thought it would be easier
to adjust the iconSVG library to enable it to store additional icons.

I've created a PR that updates the library to do so:
https://github.com/livecode/livecode/pull/6253

You can compile the LCB and replace the appropriate files in your
distribution to get the updated capability.  You will need to set the icons
via script since the browser will only show the fontawesome icons (unless
you decide to put your added icons in that family).

Added the following handlers:

iconFamilies() - returns a list of current icon families in the library
iconNamesForFamily() - returns a string list of icon names for a specified
family
iconListForFamily() - returns a LCB list of icon names for a specified
family
iconDataForFamily() - returns LCB array of icon data for a specified family
addIcon() - add an icon to the iconsvg library
addIconsForFamily() - add a family of icons to the iconsvg library

I'm not sure if the current form will make it into a distribution, but at
least it shows one way of solving the problem.

Merry Christmas!
Brian



More information about the Use-livecode mailing list