Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Different code for dockable panel.

  • Different code for dockable panel.

    Posted by Andrei Popa on August 10, 2017 at 2:15 pm

    I am curious if there is any major differences when creating a dockable panel between this two codes

    function createUI(thisObj) {
    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Tools",[100, 100, 300, 300]);
    myPanel.add("button", [10, 10, 100, 30], "Tool #1");
    return myPanel;
    }
    var myToolsPanel = createUI(this);

    function createUI(thisObj) {
    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Tools",[100, 100, 300, 300]);
    var res = "group{orientation:'column',alignChildren:'fill',button:Button{text:'Tool #1'}}";
    myPanel.grp = myPanel.add(res);

    myPanel.layout.layout(true);
    myPanel.grp.minimumSize = myPanel.grp.size;
    myPanel.layout.resize();
    return myPanel;
    }
    var myToolsPanel = createUI(this);

    I am referring as technique. Because i think it would be much easier to use the first version. And both of them have the same output. But in most scripts i see the second version. Anyone who can enlight me on this?

    Andrei

    Andrei Popa replied 8 years, 9 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy