setVisible problem on panel load

Home Forums General Programming setVisible problem on panel load

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #71810
    human fly
    Participant
      • Topics: 124
      • Replies: 1070
      • Total: 1194
      • ★★★★

      hi,
      i’m having a problem with setVisible()
      my panel is not loading modulator defaults anyway, but this
      also means the start-up view is a mess, with all setVisible
      options defined by Lua showing.

      here is a zip with a mini-panel (inc only resource, a png image).
      please have a look at the lua methods associated with ‘structure’
      selector (not the dropdown list, which is only ‘linked’ to the
      structure12/34 objects), and at the PCM Bank selectors, which
      control the choice of pcm lists 1+2.

      i have only the vaguest notion of what refresh/repaint do.
      seen, but never used.

      this may be a wider problem i’m having, with no modulators
      loading with their default setting.

      nb: these views were ok in earliest versions of this macro,
      but when i started having several instances for all the parts,
      the start-up ended up doing this.

      #71812
      human fly
      Participant
        • Topics: 124
        • Replies: 1070
        • Total: 1194
        • ★★★★

        update: this panel is ok, as an exported instance, when there is only
        one of these configurations. i have it copied 8 times in the panel, and
        that is when the start-up problem occurs.

        what is the function i need for this? i’m going to search posts for
        ‘panel refresh’, and ‘repaint’, as i don’t know what these are for.

        ie: it only wants one of the options showing, but it does not seem
        to be applying the ‘setVisible’ on start-up.(also not giving startup
        values)

        does start-up need a ‘snapshot’? how would that work?

        #71813
        human fly
        Participant
          • Topics: 124
          • Replies: 1070
          • Total: 1194
          • ★★★★

          this might be more helpful: here is the lua format. i have a feeling
          something may be needed to reset the ‘banksel’ selector (“Partial1_PCM Part1”),
          so that it chooses one or other parameter after the panel has loaded.
          (i think i need better understanding of what after/before panel ‘has loaded’
          means, in terms of state of all parameters, loading off start-up values, etc.)
          question: do i need to set a nil value to ‘banksel’, to initialize it?

          here is the lua (toggles between 2 views):


          — Called when a modulator value changes
          — @mod http://ctrlr.org/api/class_ctrlr_modulator.html
          — @value new numeric value of the modulator

          PCM1Bank_showChoice_Pt1 = function(mod, value)

          bankSel = panel:getModulatorByName(“Partial1_PCM Part1”):getValue()
          pcm1 = panel:getModulatorByName(“PCM1_P1 Part1”)
          pcm2 = panel:getModulatorByName(“PCM2_P1 Part1”)

          if
          bankSel == 0 then

          pcm1:getComponent():setVisible(true)
          pcm2:getComponent():setVisible(false)
          elseif
          bankSel == 1 then

          pcm1:getComponent():setVisible(true)
          pcm2:getComponent():setVisible(false)
          elseif
          bankSel == 2 then

          pcm1:getComponent():setVisible(false)
          pcm2:getComponent():setVisible(true)
          elseif
          bankSel == 3 then

          pcm1:getComponent():setVisible(false)
          pcm2:getComponent():setVisible(true)
          end
          end

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