Dear all,
What would be the best Pharo version to start building a Spec2 GUI for an app - Pharo 9 which is under development but with novelties in Spec2, or Pharo 8? What's the best (easiest ...) way to import new icons into Smalltalk ui icons? Is there any special bitmap format to be considered? Thanks and best wishes, Tomaz
|
Hello Tomaz
We are always developing in bleeding edge so eating our own dog food (and p9 has been nice so far). Just now we got Spec20 0.6 and it contains many improvements. I hope to be able to start to code some mini tutorial (learning myself and writing what I’m learning).
I do not have the name but you can load icons. But look around.
-------------------------------------------- Stéphane Ducasse 03 59 35 87 52 Assistant: Julie Jonas FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France |
Thanks, Stephane, I'll switch to P9. > png is better and there is a library to manage icons > I do not have the name but you can load icons. > But look around. For icons I found the necessary code in ThemeIcons>>loadIconsFromUrl. Here's a simplistic approach to load icons from PNGs in a local ZIP archive, if somebody needs it: | themeIcons newIcons | newIcons := IdentityDictionary new. themeIcons := ThemeIcons new. ((FileSystem zip: 'C:\icons\a.zip' asFileReference) open workingDirectory allChildrenMatching: '*.png') do: [ :each | newIcons at: each base asSymbol put: (themeIcons readPNGFrom: each )]. newIcons. Best wishes, Tomaz
|
thanks for sharing. I will add it to the chapter Tips of the new book on Spec20 :)
I remember also that there is a project to manage icon sets.
-------------------------------------------- Stéphane Ducasse 03 59 35 87 52 Assistant: Aurore Dalle FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France |
Hi,
> I remember also that there is a project to manage icon sets. I found the library - it's ImageForm (https://github.com/pablo1n7/ImageForm). If you use it, there's no need to use ThemeIcons>>#readPNGFrom:. The above code becomes: To make this example complete: Best wishes Tomaz -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html |
I'm sorry, the raw tag at forum.world.st ate the code :-) | newIcons | newIcons := IdentityDictionary new. ((FileSystem zip: 'C:\icons\a.zip' asFileReference) open workingDirectory allChildrenMatching: '*.png') do: [ :each | newIcons at: each base asSymbol put: (ImageForm open: each )]. SpToolBarButton new label: 'Go!'; icon: (newIcons at: #iconFileName). Tomaz |
In recent spec2 (head) we added support so that an application can have an iconProvider so it means that you can
using the ThemeIcons load and manage a set of icons for your application.
-------------------------------------------- Stéphane Ducasse 03 59 35 87 52 Assistant: Aurore Dalle FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France |
> In recent spec2 (head) we added support so that an application can have an iconProvider so it means that you can > using the ThemeIcons load and manage a set of icons for your application. This is great, thanks! Best wishes Tomaz |
Free forum by Nabble | Edit this page |