2 Replies Latest reply on Jun 14, 2016 8:51 PM by natrev

    Button creation

    aviR Level 1

      Hii all

       

      myW.pannel_ePub.buildBtn_OK = myW.pannel_ePub.add('button', [40,115,100,65], 'Ok',{name:'ok'});

      myW.pannel_ePub.buildBtn_Cancel = myW.pannel_ePub.add('button', [120,115,190,65], 'Cancel',{name:'cancel'});

       

      Where are these lines wrong?

      Buttons are not getting created.

      Please help

      Thanks

        • 1. Re: Button creation
          Pedro Cortez Marques Level 3

          I think they are there but you can't see them.

           

          You are using absolute location+size values.

          It would be advised to use instead, absolute location and relative size.

           

          Try this:

          myW.pannel_ePub.buildBtn_OK = myW.pannel_ePub.add('button', [40,115,undefined,undefined], 'Ok',{name:'ok'});

          myW.pannel_ePub.buildBtn_OK.size = [100,65];

           

          myW.pannel_ePub.buildBtn_Cancel = myW.pannel_ePub.add('button', [120,115,undefined,undefined], 'Cancel',{name:'cancel'});

          myW.pannel_ePub.buildBtn_Cancel.size = [190,65];

           

          Hope it helps!

          • 2. Re: Button creation
            natrev Level 3

            Hi,

             

            Try this code..

             

            var myW = new Window('dialog', 'Test');
            var pannel_ePub=myW.add('panel',undefined, 'Pannel_ePub');
            var buildBtn_OK = pannel_ePub.add("button",undefined, 'Ok');
            var buildBtn_Cancel = pannel_ePub.add("button",undefined, 'Cancel');
            

             

            (or)

             

            var myW = new Window('dialog', 'Test');
            var pannel_ePub=myW.add('panel',undefined, 'Pannel_ePub');
            var Btn= pannel_ePub.add("group");
            var buildBtn_OK = pannel_ePub.add("button",undefined, 'Ok');
            var buildBtn_Cancel = pannel_ePub.add("button",undefined, 'Cancel');