UI base class
hi!
i want create ui "base class" can reuse. have done test works when launch estk when launched within illustrator window flashes disappears. idea create function returns window , group can add more controls class "instantiates base class".
below simplified example of base class.
#target illustrator #targetengine main function uibase(atitle) { var win = new window ("palette", atitle); win.margins = 0; var banner = win.add ("group",[0,0,200,60]); banner.graphics.backgroundcolor = banner.graphics.newbrush (banner.graphics.brushtype.solid_color, [0.2, 0.2, 0.2]); var body = win.add ("group"); body.margins = 10; return {"win":win, "body":body}; }
the script uses base class looks this.
#include uibase.jsx winobj = new uibase("hello world!"); win = winobj["win"]; body = winobj["body"]; var btn = body.add("button", undefined, "button!"); win.show();
it super handy dont have rewrite code basic ui. said works estk not within illustrator. have ideas why not working? interested if have examples of way implementing "ui base class" can extended.
best regards,
johan
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment