JamesWang wrote:
Hello
The attachement is an applet I made.

I can use {get-the-applet}.document.document-graphic.graphical-children to access all controls in the applet except the controls in subapplet.

I tried many ways and have no idea to get Applet instance of the subapplet.
I guess the subapplet is in the different process from his parent process.
I found Curl's Inspector can get everything I want but I have no way to figure out how.

James, you are right about the subapplet being in a different process, which makes this more difficult. There are some ways to do inter-applet communication in Curl, but that might be fairly complicated for you to implement and it also depends on both applets cooperating on the communication protocol. So it would not work for something like testing or exploring arbitrary applets.

Do you think you want to know more about inter-applet communication to work on your problem? There is a package COM.CURL.CSK.IPC which comes with the Curl CSK product (maybe you already have access to that).

-- Duke



------------------------------------------------------------------------

{curl 5.1 applet}

{import * from CURL.ENGINE.BROWSER}
{let bounds:GRect =
    {{get-the-applet}.document.top-level-graphic.layout.get-bounds}
}
{let ag:AppletGraphic = {AppletGraphic
        width = bounds.width,
        height = bounds.height
    }
}

{let ad:AppletData = {AppletData ag, {string-url |"
 {curl 5.1 applet} {link href= {url
 "http://www.google.com"}, Google}{CommandButton}"|}}
}

{CommandButton
    label = "change controls' properties through document",
    {on Action do
        {let box:Box = {get-the-applet}.document.document-graphic}

        {for child in box.graphical-children do
{set child.color = "red"} }
    }
}

{CommandButton
    label = "how to control the controls in subapplet?",
    {on Action do
        {let box:Box = {get-the-applet}.document.document-graphic}

        {for child in box.graphical-children do
{set child.color = "red"} }
    }
}

{value ag}

Reply via email to