Seaside 2.6 Example?

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

Seaside 2.6 Example?

Rick Zaccone
I'm looking for a Seaside 2.6 example that uses a Canvas?  Any  
example, regardless of the size, would be useful.  Would someone  
please supply a pointer?  I didn't see anything on <http://seaside.st/>.

Rick

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

Re: Seaside 2.6 Example?

Damien Cassou-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rick Zaccone a écrit :
> I'm looking for a Seaside 2.6 example that uses a Canvas?  Any  example,
> regardless of the size, would be useful.  Would someone  please supply a
> pointer?  I didn't see anything on <http://seaside.st/>.

Have a look at Pier and Magritte, both available on SqueakMap. Canvas is
very simple to use. You can have a look at this post from Avi :
http://lists.squeakfoundation.org/pipermail/seaside/2005-June/005260.html

- --
Damien Cassou
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD1oX63hhx1vOEX5sRAiOfAKCM6kfiqFPuC7kYy+rWUe4JjBG9iACfe2YG
5jg6e0/ayKyAYgLKm4P6J5I=
=cYsl
-----END PGP SIGNATURE-----
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside 2.6 Example?

Jeremy Shute
It isn't just simpler to use, it's vastly preferable because it has a much
cleaner interface.  Too bad no one can figure out how to use it without
referring to Pier...  (I had to use Pier, myself, in order to figure this
out.)

Essentially the steps are:

1.  Augment your WAComponent to declare that it's rendered with a
different class:

WAComponent>>rendererClass
  ^ WARenderCanvas

...notice it's "rendererClass", not "renderClass", which had me kicking my
computer for a good 10 minutes.

2.  Augment your WAComponent>>renderContentOn: method to actually use the
canvas...

WAComponent>>renderContentOn: html
  (html div) with: [
    html text: 'Hello World!'
  ]

Remember that the "with:" message "paints" the brush (chain all
modifications before it, otherwise they won't appear), and go tromping
through the Seaside-Canvas and Seaside-Canvas-Tags categories to figure
out what's supported...

Good luck,

Jeremy



> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Rick Zaccone a écrit :
>> I'm looking for a Seaside 2.6 example that uses a Canvas?  Any  example,
>> regardless of the size, would be useful.  Would someone  please supply a
>> pointer?  I didn't see anything on <http://seaside.st/>.
>
> Have a look at Pier and Magritte, both available on SqueakMap. Canvas is
> very simple to use. You can have a look at this post from Avi :
> http://lists.squeakfoundation.org/pipermail/seaside/2005-June/005260.html
>
> - --
> Damien Cassou
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFD1oX63hhx1vOEX5sRAiOfAKCM6kfiqFPuC7kYy+rWUe4JjBG9iACfe2YG
> 5jg6e0/ayKyAYgLKm4P6J5I=
> =cYsl
> -----END PGP SIGNATURE-----
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


GPG PUBLIC KEY: 0xA2B36CE5

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

Re: Seaside 2.6 Example?

Jeremy Shute
Below, I use WAComponent>>rendererClass and WAComponent>>renderContentOn:.
 To be absolutely clear, I mean MyWAComponentSubclass>>rendererClass, and
MyWAComponentSubclass>>renderContentOn:.

Jeremy



> It isn't just simpler to use, it's vastly preferable because it has a much
> cleaner interface.  Too bad no one can figure out how to use it without
> referring to Pier...  (I had to use Pier, myself, in order to figure this
> out.)
>
> Essentially the steps are:
>
> 1.  Augment your WAComponent to declare that it's rendered with a
> different class:
>
> WAComponent>>rendererClass
>   ^ WARenderCanvas
>
> ...notice it's "rendererClass", not "renderClass", which had me kicking my
> computer for a good 10 minutes.
>
> 2.  Augment your WAComponent>>renderContentOn: method to actually use the
> canvas...
>
> WAComponent>>renderContentOn: html
>   (html div) with: [
>     html text: 'Hello World!'
>   ]
>
> Remember that the "with:" message "paints" the brush (chain all
> modifications before it, otherwise they won't appear), and go tromping
> through the Seaside-Canvas and Seaside-Canvas-Tags categories to figure
> out what's supported...
>
> Good luck,
>
> Jeremy
>
>
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Rick Zaccone a écrit :
>>> I'm looking for a Seaside 2.6 example that uses a Canvas?  Any
>>> example,
>>> regardless of the size, would be useful.  Would someone  please supply
>>> a
>>> pointer?  I didn't see anything on <http://seaside.st/>.
>>
>> Have a look at Pier and Magritte, both available on SqueakMap. Canvas is
>> very simple to use. You can have a look at this post from Avi :
>> http://lists.squeakfoundation.org/pipermail/seaside/2005-June/005260.html
>>
>> - --
>> Damien Cassou
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (GNU/Linux)
>> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>>
>> iD8DBQFD1oX63hhx1vOEX5sRAiOfAKCM6kfiqFPuC7kYy+rWUe4JjBG9iACfe2YG
>> 5jg6e0/ayKyAYgLKm4P6J5I=
>> =cYsl
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> Seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
> GPG PUBLIC KEY: 0xA2B36CE5
>


GPG PUBLIC KEY: 0xA2B36CE5

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

Re: Seaside 2.6 Example?

Rick Zaccone
In reply to this post by Jeremy Shute

On Jan 24, 2006, at 3:10 PM, Jeremy Shute wrote:

> It isn't just simpler to use, it's vastly preferable because it has  
> a much
> cleaner interface.  Too bad no one can figure out how to use it  
> without
> referring to Pier...  (I had to use Pier, myself, in order to  
> figure this
> out.)

[snip]

Thanks!  This is what I needed.  I haven't tried it yet, but it  
sounds simple enough.  Since it's not obvious (to me and probably  
others), this information should be on the Seaside website.

Rick

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

Re: Seaside 2.6 Example?

Philippe Marschall
In reply to this post by Jeremy Shute
> WAComponent>>renderContentOn: html
>   (html div) with: [
>     html text: 'Hello World!'
>   ]

oh no, you can still do
html div: 'Hello World!'

the basic idea is that you have a tag instance to which you can cascade massages

html div
    id: 'smapleID';
    class: 'smapleClass';
    with: [
        html span ......  ]

and this api is the same for basically any html element (list, form,
...) not only div and span.

so you can also do

html anchor
    id: 'smapleID';
    class: 'smapleClass';
    with: [
        html span ......  ]

It was made especially with #on:of in mind.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside 2.6 Example?

Jeremy Shute
I know.  :-)  I was looking for an example that allowed me to talk about
the "with:" message as brushing to the screen...  So, hello world ended up
in a div.

Jeremy



>> WAComponent>>renderContentOn: html
>>   (html div) with: [
>>     html text: 'Hello World!'
>>   ]
>
> oh no, you can still do
> html div: 'Hello World!'
>
> the basic idea is that you have a tag instance to which you can cascade
> massages
>
> html div
>     id: 'smapleID';
>     class: 'smapleClass';
>     with: [
>         html span ......  ]
>
> and this api is the same for basically any html element (list, form,
> ...) not only div and span.
>
> so you can also do
>
> html anchor
>     id: 'smapleID';
>     class: 'smapleClass';
>     with: [
>         html span ......  ]
>
> It was made especially with #on:of in mind.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


GPG PUBLIC KEY: 0xA2B36CE5

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

Re: Seaside 2.6 Example?

wilkesj
In reply to this post by Jeremy Shute
Use the source! This is Smalltalk after all, ;)

I create a class (which should be in Seaside) call WARenderCanvasComponent:

WAComponent subclass: #WARenderCanvasComponent
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SeasideExtensions'

WARenderCanvasComponent>>rendererClass
    ^ WARenderCanvas

All of my components subclass this.  Which means that renderConentOn:
is passed in an instance of WARenderCanvas.

Then I have 2 hierarchy browsers open, one for WACanvas and one for
WABrush.  I also look at WACanvasTest as a simple example to get a
feel for how the classes work.
The basic idea is that calling a method on WACanvas returns an
instance of WABrush.  From there on it is just browsing the classes to
find out what messages they understand.

Hope this helps,
Wilkes


On 1/24/06, Jeremy Shute <[hidden email]> wrote:

> Below, I use WAComponent>>rendererClass and WAComponent>>renderContentOn:.
>  To be absolutely clear, I mean MyWAComponentSubclass>>rendererClass, and
> MyWAComponentSubclass>>renderContentOn:.
>
> Jeremy
>
>
>
> > It isn't just simpler to use, it's vastly preferable because it has a much
> > cleaner interface.  Too bad no one can figure out how to use it without
> > referring to Pier...  (I had to use Pier, myself, in order to figure this
> > out.)
> >
> > Essentially the steps are:
> >
> > 1.  Augment your WAComponent to declare that it's rendered with a
> > different class:
> >
> > WAComponent>>rendererClass
> >   ^ WARenderCanvas
> >
> > ...notice it's "rendererClass", not "renderClass", which had me kicking my
> > computer for a good 10 minutes.
> >
> > 2.  Augment your WAComponent>>renderContentOn: method to actually use the
> > canvas...
> >
> > WAComponent>>renderContentOn: html
> >   (html div) with: [
> >     html text: 'Hello World!'
> >   ]
> >
> > Remember that the "with:" message "paints" the brush (chain all
> > modifications before it, otherwise they won't appear), and go tromping
> > through the Seaside-Canvas and Seaside-Canvas-Tags categories to figure
> > out what's supported...
> >
> > Good luck,
> >
> > Jeremy
> >
> >
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Rick Zaccone a écrit :
> >>> I'm looking for a Seaside 2.6 example that uses a Canvas?  Any
> >>> example,
> >>> regardless of the size, would be useful.  Would someone  please supply
> >>> a
> >>> pointer?  I didn't see anything on <http://seaside.st/>.
> >>
> >> Have a look at Pier and Magritte, both available on SqueakMap. Canvas is
> >> very simple to use. You can have a look at this post from Avi :
> >> http://lists.squeakfoundation.org/pipermail/seaside/2005-June/005260.html
> >>
> >> - --
> >> Damien Cassou
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.1 (GNU/Linux)
> >> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> >>
> >> iD8DBQFD1oX63hhx1vOEX5sRAiOfAKCM6kfiqFPuC7kYy+rWUe4JjBG9iACfe2YG
> >> 5jg6e0/ayKyAYgLKm4P6J5I=
> >> =cYsl
> >> -----END PGP SIGNATURE-----
> >> _______________________________________________
> >> Seaside mailing list
> >> [hidden email]
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >>
> >
> >
> > GPG PUBLIC KEY: 0xA2B36CE5
> >
>
>
> GPG PUBLIC KEY: 0xA2B36CE5
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Seaside 2.6 Example?

Rick Zaccone

On Jan 24, 2006, at 7:37 PM, Wilkes Joiner wrote:

> Use the source! This is Smalltalk after all, ;)
>
> I create a class (which should be in Seaside) call  
> WARenderCanvasComponent:
>
> WAComponent subclass: #WARenderCanvasComponent
> instanceVariableNames: ''
> classVariableNames: ''
> poolDictionaries: ''
> category: 'SeasideExtensions'
>
> WARenderCanvasComponent>>rendererClass
>     ^ WARenderCanvas
>
> All of my components subclass this.  Which means that renderConentOn:
> is passed in an instance of WARenderCanvas.

Wouldn't it make more sense if WAPresenter>>rendererClass was defined as

WAPresenter>>rendererClass
     ^WARenderCanvas

I thought that the thrust in Seaside 2.6 was to use a Canvas.  Why is  
WAHtmlRenderer the default?

Rick

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

Re: Seaside 2.6 Example?

Avi  Bryant

On Jan 25, 2006, at 12:16 PM, Rick Zaccone wrote:
>
> Wouldn't it make more sense if WAPresenter>>rendererClass was  
> defined as
>
> WAPresenter>>rendererClass
>     ^WARenderCanvas
>
> I thought that the thrust in Seaside 2.6 was to use a Canvas.  Why  
> is WAHtmlRenderer the default?

For backwards compatibility.  But if people are willing to add

rendererClass
   ^ WAHtmlRenderer

to all of their existing classes in order to update to 2.6, I'm more  
than happy to switch it.

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

Re: Seaside 2.6 Example?

Dmitry Dorofeev
Hi all.

I just subclassed WAComponent and have YASPComponent with no additional
methods or i-vars. All my real components subclass YASPComponent.
I do such thing for every project by the way.
Now it is very easy for me to switch to 2.6 whatever will be default renderer.
Also I can have customized dialogs for confirm: inform: etc defining them in YASPComponent.

Someone just noted this technique and I used it just for a God sake :-)

Seems this method deserves to be noted on the seaside.st ?

-Dmitry.


Avi Bryant wrote:

>
> On Jan 25, 2006, at 12:16 PM, Rick Zaccone wrote:
>
>>
>> Wouldn't it make more sense if WAPresenter>>rendererClass was  defined as
>>
>> WAPresenter>>rendererClass
>>     ^WARenderCanvas
>>
>> I thought that the thrust in Seaside 2.6 was to use a Canvas.  Why  is
>> WAHtmlRenderer the default?
>
>
> For backwards compatibility.  But if people are willing to add
>
> rendererClass
>   ^ WAHtmlRenderer
>
> to all of their existing classes in order to update to 2.6, I'm more  
> than happy to switch it.
>
> Avi
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Seaside 2.6 Example?

tblanchard
In reply to this post by Avi Bryant
 
You could include a subclass of WAComponent called WACanvasComponent and let people subclass that if they want the canvas I suppose.  Of course, this is trivial to do...

On Wednesday, January 25, 2006, at 02:17PM, Avi Bryant <[hidden email]> wrote:

>
>On Jan 25, 2006, at 12:16 PM, Rick Zaccone wrote:
>>
>> Wouldn't it make more sense if WAPresenter>>rendererClass was  
>> defined as
>>
>> WAPresenter>>rendererClass
>>     ^WARenderCanvas
>>
>> I thought that the thrust in Seaside 2.6 was to use a Canvas.  Why  
>> is WAHtmlRenderer the default?
>
>For backwards compatibility.  But if people are willing to add
>
>rendererClass
>   ^ WAHtmlRenderer
>
>to all of their existing classes in order to update to 2.6, I'm more  
>than happy to switch it.
>
>Avi
>_______________________________________________
>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
Reply | Threaded
Open this post in threaded view
|

Re: Seaside 2.6 Example?

Brian Brown-2
In reply to this post by Avi Bryant
Well, for transitional projects, like some I'm working on now, the  
older WAHtmlRenderer based code can run happily under 2.6 and my new  
stuff subclasses a common component that overrides rendererClass.


Then I can work on new parts with Canvas and the old stuff doesn't  
have to be changed at all until it's time for a refactor.

Brian

On Jan 25, 2006, at 2:17 PM, Avi Bryant wrote:

>
> On Jan 25, 2006, at 12:16 PM, Rick Zaccone wrote:
>>
>> Wouldn't it make more sense if WAPresenter>>rendererClass was  
>> defined as
>>
>> WAPresenter>>rendererClass
>>     ^WARenderCanvas
>>
>> I thought that the thrust in Seaside 2.6 was to use a Canvas.  Why  
>> is WAHtmlRenderer the default?
>
> For backwards compatibility.  But if people are willing to add
>
> rendererClass
>   ^ WAHtmlRenderer
>
> to all of their existing classes in order to update to 2.6, I'm  
> more than happy to switch it.
>
> Avi
> _______________________________________________
> 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