3 Replies Latest reply on Apr 7, 2008 1:05 PM by (Gunno_Ivansson)

    [JS] ScriptUI groups

      Hi all,

      I am exploring ScriptUI and cannot make groups to work. Items I add to groups doesn't show up.
      An example of my code look like this:

      win.radioPanel = win.add("panel", [25, 140, 295, 275]);
      win.radioPanel.rpGrp = win.radioPanel.add('group');
      win.radioPanel.rpGrp.radOne = win.radioPanel.rpGrp.add("radiobutton");

      What am I doing wrong?
        • 1. Re: [JS] ScriptUI groups
          Level 1
          Gunno,

          It's because you're setting the coordinates of the panel. There have been a couple of discussions about this here. Let ScriptUI determine the size of the panel.

          Dave
          • 2. Re: [JS] ScriptUI groups
            Level 1
            In general, use the layout manager to place things.

            When you specify the bounds like you do in the panel, the layout manager "sees" the bounds in the container, and stops. It will not layout the contents of the container. Possible "containers" are windows, panels, and groups.

            Basically, once you specify the bounds for a container, you're committed. You have to specify the bounds for everything in it.

            var win = new Window( "palette", "test" );

            win.radioPanel = win.add("panel");
            win.radioPanel.rpGrp = win.radioPanel.add('group');
            win.radioPanel.rpGrp.radOne = win.radioPanel.rpGrp.add("radiobutton");

            win.center();
            win.show();

            This will give you a dorky looking little palette.

            Regards

            Bob
            • 3. Re: [JS] ScriptUI groups
              Level 1
              Dave and Bob,

              thanks very much for the answer.

              Gunno