2 Replies Latest reply on Jan 25, 2012 9:19 AM by Jump_Over

    dialog runtime error

    Jump_Over Level 5

      Hi,

      Thats a begginer question!

      Trying to build dialog with three ways of answer:

       

      +++++++++++++++++++++++++++++++++++++++++++++++++

      function prompt_Dialog() {

                var win = new Window("dialog","3ways");

                win.p = win.add("panel", undefined, "");

                win.p.alignChildren = "right";

                win.p.alignment = "fill";

       

                win.p.g = win.p.add("group");

                win.p.g.st = win.p.g.add("statictext", undefined, "Choose the way");

       

                win.buttons = win.add("group");

                win.buttons.orientation = "row";  

                win.buttons.alignment = "center";

                win.buttons.ok = win.buttons.add("button", undefined, "Way 1", {name:"ok" });                // if pressed return 1

                win.buttons.way2 = win.buttons.add("button", undefined, "Way 2");                               // if pressed nothing happend, so return 0 by .onClick function

                win.buttons.cancel = win.buttons.add("button", undefined, "Way 3", {name:"cancel"});    //  if pressed return 2

        win.buttons.way2.onClick = function () {showDialog=0; win.hide(); win.destroy()};           // THERE IS RUNTIME ERROR HERE

       

        var showDialog = win.show();

        return showDialog;

      }

      prompt_Dialog ();

       

      ++++++++++++++++++++++++++++++++++++++++++++++++

       

      Can you help me to understand the reason of runtime error?

      Is there other way to build 3_ways_dialog (using buttons)?

       

      THX