Skip to main content
Hey Evgenii
Inspiring
April 3, 2023
Question

ae panel doesn't closes

  • April 3, 2023
  • 0 replies
  • 148 views

Hi guys, why it can be possible that my dockable palette doesn't closes on click on close button while running from window - panels, but if it is running from scripts window it works fine?

 

function buildUI(thidObj){
 var dialog =  thisObj instanceof Panel
  ? thisObj
  : new Window("window", undefined, undefined, { resizeable: false }); 

  ... //some elemenets before
  var group6 = dialog.add("group", undefined, {name: "group6"}); 
   group6.orientation = "row"; 
   group6.alignChildren = ["left","center"]; 
   group6.spacing = 10; 
   group6.margins = 0; 
   group6.alignment = ["right","top"]; 

var close = group6.add("button", undefined, undefined, {name: "close"}); 
      close.text = "Close"; 
      close.preferredSize.width = 80; 
      close.onClick = function() {
        dialog.close()
      }

return dialog
}

function showWindow(myWindow) {
  if (myWindow instanceof Window) {
      myWindow.center();
      myWindow.show();
  }
  if (myWindow instanceof Panel) {
      myWindow.layout.layout(true);
      // myWindow.layout.resize();
  }
}

var dialog = buildUi(this)
showWindow(dialog)

 

 

 

This topic has been closed for replies.