[Cuis-dev] Icons with path sequence in vector graphics
Luciano Notarfrancesco
luchiano at gmail.com
Fri Jun 26 11:05:45 PDT 2026
Yes, I'll take a look at the widgets in Cuis-Smalltalk-UI and see if
there's a way to fit it into that.
I just took a look at IconImporter and I'm not sure how to fit IconMorph
into it yet, maybe you have a clearer idea. From the apps that use the
IconImporter, do you usually need the icon as a Morph? or do you often need
a Form instead of a Morph?
I see that you have IconImporter>>getMorph:, getMorph:ofSize:, and
getMorph:ofSize:fill:, if instead of referring to the icon by a symbolic
name you just use a path data string like in IconMorph class>>example1, I
think you can do those same 3 things as: IconMorph new pathData: ...;
morphExtent: ...; color: ... (although I'm not sure it's the same meaning
of your fill: aColor, is it the foreground or the background?); and you can
send to it imageForm and get a 32 bits Form for the other 3 messages
getForm:, getForm:ofSize:, getForm:ofSize:fill:.
Another option would be to add a message 'addIcon: name pathData: aString'
that renders the icon with the given path data and stores a form in the
forms dictionary, but you would be losing the vector graphics.
Cheers,
Luciano
On Fri, Jun 26, 2026 at 10:35 PM Hilaire Fernandes <hfern at free.fr> wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260627/4cb7205c/attachment-0001.htm>
More information about the Cuis-dev
mailing list