[RESOLVED]uiComboContent – does not load content info

Home Forums General Using Ctrlr [RESOLVED]uiComboContent – does not load content info

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #661
    Cramp
    Participant
      • Topics: 11
      • Replies: 66
      • Total: 77

      hi,

      I faced to problem

      I tested code with 2 components:[b:13p8ok00] uiListBox[/b:13p8ok00] and [b:13p8ok00]uiCombo[/b:13p8ok00]
      Both of them have contents property.

      And when I’m trying this code and add variable [b:13p8ok00]text1[/b:13p8ok00] (a list of contents) for uiListBox

      [code:13p8ok00]
      alist = panel:getModulatorByName("listboxdata")
      c = alist:getComponent()
      if c ~= nil then
      c:setPropertyString ("uiListBoxContent",text1)
      end[/code:13p8ok00]

      works fine and I can see the list in uiListBox

      and the same code for uiCombo

      [code:13p8ok00]
      alist = panel:getModulatorByName("combodata")
      c = alist:getComponent()
      if c ~= nil then
      c:setPropertyString ("uiComboContent",text1)
      end
      [/code:13p8ok00]

      Doesn’t load contents – empty list

      any ideas?

      #4571
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★

        It could be a problem with the formatting of text1.

        This works for me:

        "Line1[b:kafhvfn4]n[/b:kafhvfn4]Line2[b:kafhvfn4]n[/b:kafhvfn4]Line3…"

        #4572
        Cramp
        Participant
          • Topics: 11
          • Replies: 66
          • Total: 77
          "dasfaker":1rd42eu9 wrote:
          It could be a problem with the formatting of text1.

          This works for me:

          "Line1[b:1rd42eu9]n[/b:1rd42eu9]Line2[b:1rd42eu9]n[/b:1rd42eu9]Line3…"[/quote:1rd42eu9]

          the[b:1rd42eu9] text1[/b:1rd42eu9] value was set in the code
          [code:1rd42eu9]text1 = string.format("%s%s%s",text1,text,"n")[/code:1rd42eu9]

          #4573
          dasfaker
          Keymaster
            • Topics: 80
            • Replies: 793
            • Total: 873
            • ★★★

            This code fills a uiCombo from a toggle button and works fine.

            [code:3my8mmoq]–
            — Called when a modulator value changes
            — @modulator http://ctrlr.org/api/class_ctrlr_modulator.html
            — @newValue new numeric value of the modulator

            toggle = function(modulator, newValue)
            if newValue == 1 then
            a = panel:getModulatorByName("modulator-1"):getComponent() — the combo modulator
            text1 = ""
            for n = 0, 10, 1 do
            numberLine = n
            text1 = string.format("%s%s%s%s",text1, "Line ", numberLine, "n")
            end
            a:setPropertyString("uiComboContent",text1)
            end
            end[/code:3my8mmoq]

            #4574
            Cramp
            Participant
              • Topics: 11
              • Replies: 66
              • Total: 77
              "dasfaker":1531amcx wrote:
              This code fills a uiCombo from a toggle button and works fine.

              [code:1531amcx]–
              — Called when a modulator value changes
              — @modulator http://ctrlr.org/api/class_ctrlr_modulator.html
              — @newValue new numeric value of the modulator

              toggle = function(modulator, newValue)
              if newValue == 1 then
              a = panel:getModulatorByName("modulator-1"):getComponent() — the combo modulator
              text1 = ""
              for n = 0, 10, 1 do
              numberLine = n
              text1 = string.format("%s%s%s%s",text1, "Line ", numberLine, "n")
              end
              a:setPropertyString("uiComboContent",text1)
              end
              end[/code:1531amcx][/quote:1531amcx]

              got it
              the problem was that before I set [code:1531amcx]propertyString[/code:1531amcx] I called [code:1531amcx]getComponent()[/code:1531amcx]
              Now works fine for me.

              Many thanks mate

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The forum ‘Using Ctrlr’ is closed to new topics and replies.
            There is currently 0 users and 60 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