[Newbies] Re: Resources with Monticello

Janko Mivšek janko.mivsek at eranova.si
Mon Apr 12 20:09:56 UTC 2010


Hi Sean,

On 09. 04. 2010 23:03, Sean P. DeNigris wrote:

>>> how does one work with resources (e.g. image files (GIFs, ...)) used
>>> in the application when working with Monticello and in general?

>> Due to lack of decent resource management in all Smalltalks we usually 
>> put such resources directly into methods, usually as literal array. In 
>> Aida/Web we have so called method resources and method images, in 
>> Seaside there is a FileLibrary.

> I found this post from a while back.  Is this still accurate?  If so, what
> does it mean i.e. how do you put a jpeg/bmp/whatever into a method?  And how
> to you change it back to a jpeg/bmp again?

Pretty easy. We have a tool method which reads a file and converts it
into such a method. Such method just returns a file content as byte
literal array. Concrete instance from DefaultWebStyle in Aida:

buttonCloseGif
  " '/home/mivsek/vw7.2/image/imgs/yuiForum/tab-close.gif' asFilename
       contentsAsMethod"
^#(71 73 70 56 57 97 13 0 13 0 135 0 0 77 87 90 115 116 115 64 255 64
133 143 143 138 145 144 175 181 179 158 190 245 192 218 249 198 221 250
204 225 250 211 229 251 217 232 252 223 236 252 228 230 224 230 240 253
236 244 253 242 247 254 249 251 254 0 0)

Hope this helps
Janko


-- 
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si


More information about the Beginners mailing list