Home Forums General Programming how to remove a Property?

This topic contains 1 reply, has 1 voice, and was last updated by  human fly 1 week, 2 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #73688

    human fly
    Participant

    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 1 week, 2 days ago by  human fly.
    #73692

    human fly
    Participant

    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)

You must be logged in to reply to this topic.

Comments are closed.