Hi gurus,

Canvas内にCanvasを表示する様にAddする。
Please help about Canvas class's issue.

I want to change the graphics in Canvas dynamically,
so tried to make a sample as bellow:

The steps that I intended was;

1. Canvas adds inside another Canvas
2.getting CanvasLayout within the inner Canvas class added at step 1
3. with Timer class, change the word displayed on inner Canvas
automatically.

For this purpose, I tried to use CanvasLayout.request-draw.
But it didn't work at all without clicking to the inner Canvas
object, and also double-clicking on it made a clash almost always.
---------------------------------------------------------------------
{curl 4.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}
{applet manifest = "manifest.mcurl"}

{import * from CURL.GUI.BASE}

{value
    let c0:Canvas =
        {Canvas background="red", width=20cm, height=10cm}
    let c:Canvas =
        {Canvas "first",background="lime", width=10cm, height=5cm}
    let nc:int = 0
    let cl:CanvasLayout = ({c.child-array.get 0} asa CanvasLayout)
    {set cl.graphic = "second"}
    {c.set-anchor cl, CanvasAnchor.top-left}
    {c0.add c}

    let t:Timer =
        {Timer
            interval = 2s,  repeat = 100,  delay = 0s,
            {on TimerEvent do
                set nc = nc + 1
                {if nc rem 2 == 0 then
                    {set cl.graphic = "Even"}
                    {cl.request-draw
                       {cl.non-null-parent.get-layout-context}}
                 else
                    {set cl.graphic = "Odd"}
                    {cl.request-draw
                       {cl.non-null-parent.get-layout-context}}
                }
            }
        }
    c0
}
----------------------------------------------------------------------

Please tell me where is wrong?

Regards.

-- 
-----
Maekawa Takanobu
e-mail:[EMAIL PROTECTED]
CANSOFT,INC.Tel:044(969)9747 Fax:044(969)9748
http://www.cansoft.co.jp/

*******************************************
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]

Reply via email to