Inserting graphics with Seaside and VisualWorks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Inserting graphics with Seaside and VisualWorks

Carl Gundel
I'm trying to use the same code that Seaside uses to insert graphics into my
Seaside application.  The following is used in a couple of places in Seaside
to inject a banner.

   html
      imageWithDocument: SeasidePlatformSupport seasideBanner
      mimeType: 'image/jpeg'
      fileName: 'seaside.jpg'.

The method seasideBanner returns an instance of ByteArray.  I have install a
jpeg in the form of a CachedImage by loading my jpeg file using:

     ImageReader imageFromFile: (OpenFileDialog new select) toClass:
RunBASIC selector: #banner

but the image does not show up when my app runs.  I guess that perhaps I
need to serve up my image as a ByteArray but I cannot seem to find any way
to produce the same format as the Seaside example has.

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Inserting graphics with Seaside and VisualWorks

Boris Popov, DeepCove Labs (SNN)
There's an easier way if you're developing something beyond a simple
experiment. Check out a bundle in Public Repository called
SeasideImageTools, which contains a whole separate seaside-based application
for managing your Seaside resources such as scripts, styles and images. In
your case, you'd need a class to hold onto the pictures, say MyPictures,
which you can create with the designer tool itself. Once you upload images
to MyPictures, they get stored in methods there for later inclusion in your
rendering code via,

(html image)
  url: (self pictures addToPath: 'banner');
  altText: 'My Happy Banner'

where #pictures is something along the lines of,

^WAUrl new addToPath: '/images/MyPictures'

(or '/seaside/go/images/MyPictures' if you don't have SeasideShortPath
loaded)

Once you load SeasideImageTools, navigate your browser over to,

http://localhost:8008/WebDesignerTool

(or http://localhost:8008/seaside/go/WebDesignerTool if you don't have
SeasideShortPath loaded)

Did I mention you might want to load SeasideShortPath? :)

Hope this helps,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Carl Gundel
Sent: Tuesday, July 18, 2006 1:17 PM
To: [hidden email]
Subject: [Seaside] Inserting graphics with Seaside and VisualWorks

I'm trying to use the same code that Seaside uses to insert graphics into my
Seaside application.  The following is used in a couple of places in Seaside
to inject a banner.

   html
      imageWithDocument: SeasidePlatformSupport seasideBanner
      mimeType: 'image/jpeg'
      fileName: 'seaside.jpg'.

The method seasideBanner returns an instance of ByteArray.  I have install a
jpeg in the form of a CachedImage by loading my jpeg file using:

     ImageReader imageFromFile: (OpenFileDialog new select) toClass:
RunBASIC selector: #banner

but the image does not show up when my app runs.  I guess that perhaps I
need to serve up my image as a ByteArray but I cannot seem to find any way
to produce the same format as the Seaside example has.

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com


_______________________________________________
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

smime.p7s (4K) Download Attachment