Hi,
Suppose I need to bundle a Pharo application (a package) I am developing with some custom icons: is there any "standard"/ agreed-upon method to do that in Pharo? For example the MenuIcons class includes byte strings (automatically I assume) converted from some external PNG files that show up as icons with menu items: which tool can be used to create a class with set of icons for an arbitrary application? If I want to reuse icons for standard actions in my application, which is the proper way to access menu icons other than to directly access these stored images? Thanks. PS Other than the "by example" books (both Squeak and Pharo) which give some basics of building GUI for applications, are there any general guidelines for GUI building in these systems? -- Dimitry Golubovsky Anywhere on the Web |
I know that fernando was building an infrastructure for icons.
But I did not see him recently on the list. Stef On Jan 12, 2011, at 3:50 PM, Dimitry Golubovsky wrote: > Hi, > > Suppose I need to bundle a Pharo application (a package) I am > developing with some custom icons: is there any "standard"/ > agreed-upon method to do that in Pharo? > > For example the MenuIcons class includes byte strings (automatically I > assume) converted from some external PNG files that show up as icons > with menu items: which tool can be used to create a class with set of > icons for an arbitrary application? > > If I want to reuse icons for standard actions in my application, which > is the proper way to access menu icons other than to directly access > these stored images? > > Thanks. > > PS Other than the "by example" books (both Squeak and Pharo) which > give some basics of building GUI for applications, are there any > general guidelines for GUI building in these systems? > > -- > Dimitry Golubovsky > > Anywhere on the Web > |
In reply to this post by Dimitry Golubovsky
Hi Dimitry,
Recently I did a little tool which I've used as a general resource importer, it's in beta state but you may use it for your purposes. Basically it takes files in a directory and imports them as "resources" or methods in a Smalltalk class. A resource is simply a Dictionary in a class variable where your resource will be imported. So you may store the imported resources (in your case icons) 1) As methods in a library class. The naming of selectors is taken from the file name, lowercasing the first letter and including the extension letters if found. 2) As 'resources' in a class variable acting as an IdentityDictionary. Obviously importing as resources is a LOT faster because it doesn't encode the images and also doesn't compile methods. To import pictures located in a folder in a class MyPicturesClass1 as methods, evaluate: LDPictureLibraryImporter named: #MyPicturesClass1. To import pictures as resources LDPictureLibraryImporter new importAsResources; named: 'MyPicturesClass2'. After you've finished the importing as methods you may want to explore: | pics | pics := MyPicturesClass1 new. ( MyPicturesClass1 organization listAtCategoryNamed: #autogenerated ) collect: [: sel | pics perform: sel ] In the case of resources just evaluate MyPicturesClass2 resources To try it: http://www.squeaksource.com/LibraryImporter.html Cheers, 2011/1/12 Dimitry Golubovsky <[hidden email]>: > Hi, > > Suppose I need to bundle a Pharo application (a package) I am > developing with some custom icons: is there any "standard"/ > agreed-upon method to do that in Pharo? > > For example the MenuIcons class includes byte strings (automatically I > assume) converted from some external PNG files that show up as icons > with menu items: which tool can be used to create a class with set of > icons for an arbitrary application? > > If I want to reuse icons for standard actions in my application, which > is the proper way to access menu icons other than to directly access > these stored images? > > Thanks. > > PS Other than the "by example" books (both Squeak and Pharo) which > give some basics of building GUI for applications, are there any > general guidelines for GUI building in these systems? > > -- > Dimitry Golubovsky > > Anywhere on the Web > > -- Hernán Morales Information Technology Manager, Institute of Veterinary Genetics. National Scientific and Technical Research Council (CONICET). La Plata (1900), Buenos Aires, Argentina. Telephone: +54 (0221) 421-1799. Internal: 422 Fax: 425-7980 or 421-1799. |
In reply to this post by Dimitry Golubovsky
By the way you may use too
MenuIcons createNewIconMethodsFromDirectory: 'C:\MyIcons\' filenames: #('icon1' 'icon2' ...) classified: '*myresourcespackage' Cheers, 2011/1/12 Dimitry Golubovsky <[hidden email]>: > Hi, > > Suppose I need to bundle a Pharo application (a package) I am > developing with some custom icons: is there any "standard"/ > agreed-upon method to do that in Pharo? > > For example the MenuIcons class includes byte strings (automatically I > assume) converted from some external PNG files that show up as icons > with menu items: which tool can be used to create a class with set of > icons for an arbitrary application? > > If I want to reuse icons for standard actions in my application, which > is the proper way to access menu icons other than to directly access > these stored images? > > Thanks. > > PS Other than the "by example" books (both Squeak and Pharo) which > give some basics of building GUI for applications, are there any > general guidelines for GUI building in these systems? > > -- > Dimitry Golubovsky > > Anywhere on the Web > > |
Free forum by Nabble | Edit this page |