• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ae panel doesn't closes

Participant ,
Apr 03, 2023 Apr 03, 2023

Copy link to clipboard

Copied

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)

 

 

 

TOPICS
Scripting

Views

90

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation