8 Replies Latest reply on Sep 14, 2011 3:42 PM by Trevorׅ

    DIALOGS stay open but PALETTES and WINDOWS disappear straight away!

    Trevorׅ Adobe Community Professional

      When I make the window type a "dialog" it stays open but if I make it a "palette" or "window" it closes straight away. How do I fix this problem? I'm sure it's dead easy
      The below script demonstrates the problem

      //DIALOGS stay open but PALETTES and WINDOWS disappear straight away!
      //When I make the window type a "dialog" it stays open but if I make it a "palette" or "window" it closes straight away. How do I fix this problem?
      //The below script demonstrates the problem
      
      w = new Window ("dialog", "DIALOGS stay but PALETTES and WINDOWS disappear straight away", undefined, {borderless: false}); // the dialog stays on the screen
      
      w.margins = [30,30,30,30];
      var myInputGroup = w.add ("group");
      myInputGroup.add ("statictext", undefined, "Problem:");
      var myText = myInputGroup.add ("edittext", undefined, "DIALOGS stay open but PALETTES and WINDOWS disappear straight away");
      myText.characters = 70;
      w.layout.layout();
      myText.active = true;
      var myButtonGroup = w.add ("group");
      myButtonGroup.alignment = "right";
      myButtonGroup.add ("button", undefined, "OK");
      myButtonGroup.add ("button", undefined, "Cancel");
      if (w.show () == 1)
      alert (myText.text);
      else
      exit ();
      
      // same script were window is a palette
      
      q = new Window ("palette", "DIALOGS stay but PALETTES and WINDOWS disappear straight away", undefined, {borderless: false}); // the palette disappears straight away
      
      q.margins = [30,30,30,30];
      var myInputGroup = q.add ("group");
      myInputGroup.add ("statictext", undefined, "Problem:");
      var myText = myInputGroup.add ("edittext", undefined, "DIALOGS stay open but PALETTES and WINDOWS disappear straight away");
      myText.characters = 70;
      q.layout.layout();
      myText.active = true;
      var myButtonGroup = q.add ("group");
      myButtonGroup.alignment = "right";
      myButtonGroup.add ("button", undefined, "OK");
      myButtonGroup.add ("button", undefined, "Cancel");
      if (q.show () == 1)
      alert (myText.text);
      else
      exit ();
      
      

      Thanks in advance