how to use WAFormDecoration

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

how to use WAFormDecoration

Frank Sukhu
Greetings,
 
I am trying to figure out how to use WAFormDecoration  ( I am trying to complete exercise 34 in Lukas Renggli's tutorial - a great tutorial).  The only example in my image that I could find that uses WAFormDecoration is WAFormDialog but it does not really help my understanding.
 
Are there any examples that illustrate how to use aWAFormDecoration?
 
Many thanks,
Frank

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

Re: how to use WAFormDecoration

Lukas Renggli
> I am trying to figure out how to use WAFormDecoration  ( I am trying to
> complete exercise 34 in Lukas Renggli's tutorial - a great tutorial).

Thanks ;-)

> The
> only example in my image that I could find that uses WAFormDecoration is
> WAFormDialog but it does not really help my understanding.

Hi Frank,

I guess exercise 34 is about adding decoration to a component (I don't
exactly know because I don't have the exercises ready). So what you
probably want to do is to decorate your editor with a form and with
buttons, exactly what WAFormDecoration is there for.

Add something like the following code to the #initialize method of
your component:

SomeComponent>>initialize
        super initialize.
        self addDecoration: (WAFormDecoration new
                buttons: #( ok cancel );
                yourself)

The setter #buttons defines the button-selectors that will be called
on your component, this means you should also implement
SomeComponent>>ok and SomeComponent>>cancel accordingly.

Hope this helps,
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: how to use WAFormDecoration

Frank Sukhu
In reply to this post by Frank Sukhu
Thanks for the explanation.  I have inplemented the messages STPlayEdit>>ok and STPlayEdit>>cancel  but I get a doesNotUnderstand when I run it.  Here is the stack trace that I get:
 
  • STEditPlay(Object)>>doesNotUnderstand: 'ok'
    self a STEditPlay
    temps
    aMessage ok
    inst vars
    decoration a WAStateHolder(a WAAnswerHandler)
  • MessageSend>>value
    self MessageSend('ok' -> a STEditPlay)
    temps
    inst vars
    receiver a STEditPlay
    selector 'ok'
    arguments #()
  • WAActionCallback>>evaluateWithArgument:
    self a WAActionCallback
    temps
    anObject 'Ok'
    inst vars
    context a WARenderingContext
    owner a WAFormDecoration
    key '4'
    block MessageSend('ok' -> a STEditPlay)
  • I have been digging into the code to try to figure out what could be going wrong, after all, it seems pretty simple,  but so far I cannot explain why the call to my STPlayEdit>>ok  method fails.
     
    Any pointers would be greatly appreciated.
     
    Thanks,
    Frank

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

    Re: Re: how to use WAFormDecoration

    Lukas Renggli
    > selector 'ok'

    Could it be that your selector is the string 'ok' instead of the symbol #ok?

    Cheers,
    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: how to use WAFormDecoration

    Frank Sukhu
    In reply to this post by Frank Sukhu
    How embarassing, I have found my problem and it was a typo on my part.  All I can say is sorry and thanks.  Things now work perfectly.

    ... Frank

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