I thought I would try out the Responsive Layout with that navigation bar widget to handle moving my controls around.
Worked quite well except the icons available in the IDE were not suitable for my needs.
I had previously used SVG widgets as buttons and drew the SVGs I wanted.
Asking on the forum and also the mothership I was pointed to the Addicon function.
This takes an SVG path and adds it to a "custom" icon library.
Unfortunately this only exists for the IDE session you are in and the library is not saved with you stack.
Hence the AddIcon function must be called when you open your stack each time.
That't OK, but where to store the SVG paths required?
I not sure when but LC now allows you to drag an SVG file on to a card and produce a SVG widget with the SVG path from the dragged file.
So if you, like me, have a card in your stack where you store the odd resource you can simply store the SVG widgets there.
Here is my resources card from my test stack: With widgets "stacks", "collections","favminus","favadd"
To load these widgets so they will be available to my stack I place the following code in the first card:
Code: Select all
on preOpenCard
put the iconpath of widget "favadd" of cd "resources" into ip
get addicon("favadd",ip,9)
put the iconpath of widget "collections" of cd "resources" into ip
get addicon("collections",ip,10)
put the iconpath of widget "favminus" of cd "resources" into ip
get addicon("favminus",ip,9)
put the iconpath of widget "stacks" of cd "resources" into ip
get addicon("stacks",ip,10)
end preOpenCard
in the message box...
setCurrentIconFamily("custom")
Now they will appear in the PI of the header/navigation bars when you click on an icon to change.
to get back to the inbuilt library...
setCurrentIconFamily("fontawesome")
So how did it work?