Good day. I have found a problem where you cannot add controls in another function if you are using a pallete window type. Have a look at this example.
myButton.onClick = function () {
var myWindow = new Window("dialog", "My Window");
var myPanel = myWindow.add("panel", undefined, "Panel Title");
myPanel.alignment = "fill";
addButton(myPanel);
myWindow.show();
}
function addButton(panel) {
panel.add("button", undefined, "OK");
}
This code will only work if the window is a `dialog` type. If it is a `palette` type, it won't work. With `palette` the window flickers for a milisecond and then goes away. This is a small example, but in practise this is quite a large hinderance to a project. It means you cannot reuse any UI building logic in multiple places. Is there any temporary solution to this issue?