Problem with Images

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

Problem with Images

Rick Zaccone
I am trying to display an image with Seaside.  I'm using Squeak  
3.8.   This works:

renderContentOn: html
     html image: '/bunnies.jpg'

If I change rendererClass so that I'm using the new API, it no longer  
works:

rendererClass
     ^WARenderCanvas

Instead, I just get the string /bunnies.jpg in my browser.  The HTML  
generated is

<img />/bunnies.jpg

which clearly isn't right.  Would someone please tell me what's wrong  
here?

Rick

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

Re: Problem with Images

Rick Flower
Rick Zaccone wrote:

> I am trying to display an image with Seaside.  I'm using Squeak 3.8.  
> This works:
>
> renderContentOn: html
>     html image: '/bunnies.jpg'
>
> If I change rendererClass so that I'm using the new API, it no longer
> works:
>
> rendererClass
>     ^WARenderCanvas
>
> Instead, I just get the string /bunnies.jpg in my browser.  The HTML
> generated is
>
> <img />/bunnies.jpg
>
> which clearly isn't right.  Would someone please tell me what's wrong
> here?
Rick -- try something like the following and see if that works better --
it works for me with the new API..

html image url: '/bunnies.jpg'; altText: 'Bunnies'.


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

Re: Problem with Images

Philippe Marschall
In reply to this post by Rick Zaccone
2006/3/7, Rick Zaccone <[hidden email]>:
> Would someone please tell me what's wrong
> here?

The old and the new renderer don't have a compatible interface.

the correct way to do that with new renderer is:
html image url: '/bunnies.jpg'

to be honset I can't imagine a possible use for

image: aBlock
        ^ self image with: aBlock

it should perhaps be changed to

image: aBlock
        self image url: aBlock

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

Re: Problem with Images

Rick Zaccone
In reply to this post by Rick Flower

On Mar 7, 2006, at 3:04 PM, Rick Flower wrote:

> Rick Zaccone wrote:
>> I am trying to display an image with Seaside.  I'm using Squeak  
>> 3.8.   This works:
>>
>> renderContentOn: html
>>     html image: '/bunnies.jpg'
>>
>> If I change rendererClass so that I'm using the new API, it no  
>> longer works:
>>
>> rendererClass
>>     ^WARenderCanvas
>>
>> Instead, I just get the string /bunnies.jpg in my browser.  The  
>> HTML generated is
>>
>> <img />/bunnies.jpg
>>
>> which clearly isn't right.  Would someone please tell me what's  
>> wrong here?
> Rick -- try something like the following and see if that works  
> better -- it works for me with the new API..
>
> html image url: '/bunnies.jpg'; altText: 'Bunnies'.

Thanks Rick.  That does indeed work.

Rick

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

Re: Problem with Images

Rick Zaccone
In reply to this post by Philippe Marschall

On Mar 7, 2006, at 3:11 PM, Philippe Marschall wrote:

> 2006/3/7, Rick Zaccone <[hidden email]>:
>> Would someone please tell me what's wrong
>> here?
>
> The old and the new renderer don't have a compatible interface.
>
> the correct way to do that with new renderer is:
> html image url: '/bunnies.jpg'
>
> to be honset I can't imagine a possible use for
>
> image: aBlock
> ^ self image with: aBlock
>
> it should perhaps be changed to
>
> image: aBlock
> self image url: aBlock
>
> Philippe

Yes, and maybe for consistency you should be able to write

html image with: '/bunnies.jpg'

Most (but not all) of the new API supports using with:.

Rick

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

Re: Problem with Images

Philippe Marschall
> Yes, and maybe for consistency you should be able to write
>
> html image with: '/bunnies.jpg'
>
> Most (but not all) of the new API supports using with:.

Yes, but with: is for content, I don't know of a case where an
img-element can meaningfully have content.

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside