Hi,
Is there a way to actually see the images in the Cache of this object? When I do an inspect on the class variable #cache I can see that it is pointing to a Dictionary but cannot see what's in it. I tried inspect, browse etc but cannot figure out how to look inside and see what images and other documents are in it, say when the example counter is running. (which should have 'seaside-top.jpg') This perhaps is a Squeak question and I quite new to it. Sorry if this is OT. -bakki _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Bakki Kudva a écrit :
> Hi, > > Is there a way to actually see the images in the Cache of this object? > When I do an inspect on the class variable #cache I can see that it is > pointing to a Dictionary but cannot see what's in it. I tried inspect, > browse etc but cannot figure out how to look inside and see what > images and other documents are in it, say when the example counter is > running. (which should have 'seaside-top.jpg') The cached images are stored as raw bytes in the Smalltalk image. The "seaside-top" is returned as raw bytes by class method #seasideBanner of SeasidePlatformSupport . In Squeak, the inspector is not able to display those strings of bytes. However you can turn those bytes into images using Seaside rendering methods. For instance, using file names cache := WACachedDocument classPool at: #Cache. cache do: [:image | html image width: 100 px; fileName: image fullFileName]. using raw bytes cache do: [:image | html image width: 100 px; document: image asMIMEDocument]. using even rawer bytes cache do: [:image | html image width: 100 px; document: image asMIMEDocument content]. Finally to display an image from raw bytes returned by a method html image document: SeasidePlatformSupport seasideBanner. Cheers Michel. _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Michel,
Thank you very muc for that great explanation. I am learning Squeak and Seaside much faster because of the quality of the traffic on this list! -bakki On 8/18/06, Michel Bany <[hidden email]> wrote: > Bakki Kudva a écrit : > > > Hi, > > > > Is there a way to actually see the images in the Cache of this object? > > When I do an inspect on the class variable #cache I can see that it is > > pointing to a Dictionary but cannot see what's in it. I tried inspect, > > browse etc but cannot figure out how to look inside and see what > > images and other documents are in it, say when the example counter is > > running. (which should have 'seaside-top.jpg') > > > The cached images are stored as raw bytes in the Smalltalk image. The > "seaside-top" > is returned as raw bytes by class method #seasideBanner of > SeasidePlatformSupport . > In Squeak, the inspector is not able to display those strings of bytes. > > However you can turn those bytes into images using Seaside rendering > methods. > For instance, using file names > cache := WACachedDocument classPool at: #Cache. > cache do: > [:image | > html image width: 100 px; fileName: image fullFileName]. > using raw bytes > cache do: > [:image | > html image width: 100 px; document: image asMIMEDocument]. > using even rawer bytes > cache do: > [:image | > html image width: 100 px; document: image asMIMEDocument content]. > Finally to display an image from raw bytes returned by a method > html image document: SeasidePlatformSupport seasideBanner. > > Cheers > Michel. > > > > > > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |