Yeah, of course in Smalltalk everything is possible
;-) Have
a look at the smilies, however I doubt that this code works,
it has been written back in the VisualWorks days.
Here is the code that works in Squeak to read a directory of images. Then
each image is stored as an array in a method with the same name.
| contents source fileStream |
(self directory fileNamesMatching: '*.png') do: [:imageName |
fileStream := self directory readOnlyFileNamed: imageName.
contents := [ fileStream contents asByteArray ]
ensure: [ fileStream close ].
source := String streamContents: [ :stream |
stream nextPutAll: (self convertFileNameToSelector:
imageName); cr.
stream tab; nextPutAll: '^ #('.
contents
do: [:element | element storeOn: stream ]
separatedBy: [ stream space ].
stream nextPut: $); space; nextPutAll:
'asByteArray.' ].
self class compile: source classified: #images.
].
And for the
style-sheets the tricky part is somewhere else, maybe ask
that to the Seaside list ...
Ok, so far I didn't receive the answer that I would like to hear. ;)
I tried the suggestion of Pavel (subclassing WAKom and overriding
#processHttpRequest:) and it does not yet work, but I have expected that
there would be a better way of doing it anyway...
- I enhanced your enhancement to reject possible
commands
slightly, so that the structure instance is asked with the
command-class and the context if this command is valid. I
need this, in some of my newly created classes. I hope this
suits your needs as well?
Yes, it works now in the newest version of SW2 as I need it, thanks.
David