[Cuis-dev] Icons with path sequence in vector graphics

Hilaire Fernandes hfern at free.fr
Fri Jun 26 08:35:03 PDT 2026


Le 25/06/2026 à 10:40, Luciano Notarfrancesco a écrit :
> Yes, I'll share my widgets, I should make a new package independent 
> from my app. Anyway, feel free to extract and use/change anything from 
> my packages.

Try to blend your widgets in the existing class categories of 
Cuis-Smalltalk-UI then maintain them from there. This is what I did for 
the DrGeo widgets


> Regarding your experience of slow drawing of vectorized icons vs fast 
> drawing of bitmap icons, I think that's not the case any more. Vector 
> graphics works really fast for me. For example, in the tracker I have 
> this big grid of text, and all the empty cells are the same,

Possibly. I did not count that at the first instantiation of the 
circular toolbar (it has many icons), the icons are loaded from svg 
file, then cached as Form at the wished size.


> something like '-- --- -- --- ---'. Typically you might have 100-300 
> empty cells that need to be redrawn several times per second, and I 
> thought calling drawString: for each empty cell was going to be slow, 
> so I made a Form for this and I called image:at: instead. But later on 
> I realized it was slower than actually drawing the string. Perhaps I 
> made some mistake, but anyways drawing all the strings is super fast 
> and I removed the form cache.

Yeah, sometime we want to optimize to early.

> About the dictionary iconName -> icon, at this time I think I prefer 
> to just specify the icon with the path data string and avoid the 
> global registry of icons, it's simpler, keeps everything local. But I 
> have very few, perhaps it's different for a project like yours with 
> lots of icons. I recommend you to add support for path data strings, 
> tho, I love it, it makes it super easy to browse icons on the web and 
> copy and paste to Cuis.

Yes, that's handy.

Will there but use to add your way of doing with IconMorph in the 
Cuis-Smalltalk-UI IconImporter class. The idea of this class is to cache 
the icon when it comes from file (PNG or SVG).

Hilaire

-- 
http://mamot.fr/@drgeo



More information about the Cuis-dev mailing list