CtrlrLuaUtils

Home Forums General Programming CtrlrLuaUtils

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6473
    SWB
    Participant
      • Topics: 35
      • Replies: 157
      • Total: 192
      • ★★

      I use CtrlrLuaUtils to invoke a window to allow a user to input (in my case) a (preset)name:

      perName = utils.askForTextInputWindow(“Performance Name”,””,”Grand Piano”,”New name:”,false,”OK”,”Cancel”).

      Basically it works fine, but the strange thing is that each time I start Ctrlr it ALWAYS shows this window first. When I click on a button the window disappears and the rest of the panel is shown. This is a bit annoying. How can one avoid this behavior?

      Secondly, how do I know which button is clicked by an user?

      Thans for any input or help!

      #6484
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        Have a loop at the PopupMenu demo, it shows how to avoid things popping up on start

        #6487
        SWB
        Participant
          • Topics: 35
          • Replies: 157
          • Total: 192
          • ★★

          Thanks! I show the code here, so other forum members can also benefit.

          function storePerformance()

          if panel:getBootstrapState() then — avoid showing the dialog window at startup

          return

          end

          inputPerformanceName() — calls the dialog window to input user text

          mySysex = CtrlrMidiMessage({0xF0, 0xB0, 0x75, 0x00, 0x13, 0xF7})

          panel:sendMidiMessageNow(mySysex)

          end

          ——————————————————————-

          function inputPerformanceName()

          perfName = utils.askForTextInputWindow(“Performance Name”,””,”Grand Piano”,”New name:”,false,”OK”,”Cancel”)

          pn = string.format(perfName)

          console(pn)

          end

          Still my question how to know which button (OK or Cancel) is clicked. I try of course to find out myself, but it saves time if someone points me in the direction where to look 😉

          #6489
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            With that call you can’t tell witch button was clicked, there is a special class for that called AlertWindow i’ll add that to Ctrlr soon, those utils. calls are not too complicated.

            #6490
            SWB
            Participant
              • Topics: 35
              • Replies: 157
              • Total: 192
              • ★★

              Thanks! Do I have to wait until you have added that class or is there another way to get user input?

              #6491
              atom
              Keymaster
                • Topics: 159
                • Replies: 2945
                • Total: 3104
                • ★★★★★

                Please wait i’ll add this today i hope with an example panel.

                #6492
                SWB
                Participant
                  • Topics: 35
                  • Replies: 157
                  • Total: 192
                  • ★★

                  OK. TIA!

                  #71951
                  Mr.ToR
                  Participant
                    • Topics: 7
                    • Replies: 51
                    • Total: 58

                    was this issue resolved?
                    I can not obtain which button was clicked as well.
                    This applies to utils.askForTextInputWindow
                    utils.questionWindow tells which button was clicked.

                    #81987
                    goodweather
                    Participant
                      • Topics: 45
                      • Replies: 550
                      • Total: 595
                      • ★★★

                      Getting into the same issue.
                      Does anyone knows how to know the user has pressed the Cancel button?
                      If this is not possible, what workaround are you using?
                      Thx in advance!

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • The forum ‘Programming’ is closed to new topics and replies.
                    There is currently 0 users and 68 guests online
                    No users are currently active
                    Forum Statistics
                    Threads: 2,495, Posts: 17,374, Members: 77,605
                    Most users ever online was 12 on January 22, 2019 3:47 pm
                    Ctrlr