how to remove a Property?

Home Forums General Programming how to remove a Property?

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

      i’ve forgotten how this is done.
      dnaldoog found out how to do it.

      i’ve ‘created’ extraneous properties again 🙂
      > uiGroup ‘modulator’ now has an extra property
      called outlineColour1, as well as the same property
      for its ‘component’ (look at a uiGroup property list,
      you’ll see).

      this is surprisingly easy to do accidentally.
      please refresh my memory on this? or where to look
      for the info ?
      (better: look at the file attached to most recent post
      for the ‘simple sequencer’ v41)
      thanks.

      • This topic was modified 6 years, 3 months ago by human fly.
      #73692
      human fly
      Participant
        • Topics: 124
        • Replies: 1070
        • Total: 1194
        • ★★★★

        ok i can answer that now …
        answer is here: ‘removeProperty’
        https://juce.com/doc/classDynamicObject

        what i had done, was the iterate a setProperty() operation
        on a property that did not exist, by using getModulatorByName()
        instead of getComponent() – ie: “uiGroupOutlineColour1”

        so i created a new property of the same name, belonging to the
        modulator (as well as the one belonging to the component).

        in order to remove this new property, i wrote a little method
        called remove property, and made a button for it:

        function removeExtraProperty()
        
        	for i = 1,16 do
        	_G["grp_step"..i]= panel:getModulatorByName("grp_step"..i):removeProperty("uiGroupOutlineColour1")
        	end
        end

        probably didn’t need this bit? > _G["grp_step"..i]

        (um but not before screwing it up and deleting the wrong
        property first. don’t know how i’m going to re-instate
        that .. ie: to be used with caution .. )

        edit: seems to be ok so far. but one of my groups does not
        have a modulator ‘current value’, whereas all the others do.
        (don’t see why a uiGroup modulator would have a value ? …)

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