Simple new method with a periodical on WATagbrush

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

Simple new method with a periodical on WATagbrush

Leandro Pérez
Hello everyone!

I want to add a simple method similar to this one below to WATagBrush:

WATagBrush >> time:initialRenderBlock
        self with: initialRenderBlock.
        canvas script: ((canvas periodical)
                                assignTo: 'my_periodical';
                                frequency: 2 seconds;
                                callback: [:r | r render:Time now ])

it would be used like this:

renderContentOn:html
      html div time:'Calculating time...'.

The effect would be the same as:
renderContentOn:html
html div script: ((html periodical)
                assignTo: 'my_periodical';
                frequency: 5 seconds;
                callback:[:r | html render: Time now]);

The problem is, when the page is rendered, "Calculating time..." appears but nothing more happens, the periodical is not there...

this is not particularly what i need to do, but works well as an explanation example.

any ideas?
i'm currently using
        VisualWorks NonCommercial, 7.5
        Seaside2.7b1
        Scriptaculous2.6-mb.8

thanks in advance, best regards
Leandro

Reply | Threaded
Open this post in threaded view
|

Re: Simple new method with a periodical on WATagbrush

Lukas Renggli
> WATagBrush >> time:initialRenderBlock
>         self with: initialRenderBlock.
>         canvas script: ((canvas periodical)
>                                 assignTo: 'my_periodical';
>                                 frequency: 2 seconds;
>                                 callback: [:r | r render:Time now ])

#with: has always to be the last message you send to a brush. It
triggers the streaming of the contents, anything you specify
afterwards will be ignored. Also check out the method comment of
#with:

Lukas

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

Re: Simple new method with a periodical on WATagbrush

Leandro Pérez
Thanks Lukas!
I replaced
self with: initialRenderBlock.
         canvas script: ((canvas periodical)
                                 assignTo: 'my_periodical';
                                 frequency: 2 seconds;
                                 callback: [:r | r render:Time now ])

with:

         self script: ((canvas periodical)
                                 assignTo: 'my_periodical';
                                 frequency: 2 seconds;
                                 callback: [:r | r render:Time now ]);with: initialRenderBlock.

and it worked.
I appreciate your help a lot, greetings from Argentina
Leandro


Lukas Renggli wrote
> WATagBrush >> time:initialRenderBlock
>         self with: initialRenderBlock.
>         canvas script: ((canvas periodical)
>                                 assignTo: 'my_periodical';
>                                 frequency: 2 seconds;
>                                 callback: [:r | r render:Time now ])

#with: has always to be the last message you send to a brush. It
triggers the streaming of the contents, anything you specify
afterwards will be ignored. Also check out the method comment of
#with:

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
Seaside@lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside