I have one of those simple-but-involved questions that I've done a lot -- yet perhaps insufficient amount -- of research and testing on and I'm stymied on something that is fairly simple in a lot of frameworks I've used but is somehow missing here or I'm missing something staggeringly obvious in how to trigger it.
Inside the Ace3 options table are these little beasties...
Code:
set = function(info,val) MyAddon.enabled = val end,
get = function(info) return MyAddon.enabled end
They're generally happy and straight forward since the data you
set remains visibly in the control.
The problem I'm running into is that data in the control itself is reflected in another part of the options table. Using the above generic example, imagine the following from another leaf in the options table:
Code:
icon=function()
if MyAddon.enabled then return MyAddon.icon.enabled
else return MyAddon.icon.disabled
end
end
When the aforementioned
set is executed in leaf A the
icon function in leaf B doesn't update, which is fine and there's nothing inherently wrong with that.
What I can't figure out is how to signal
icon in leaf B or leaf B itself to update.
Obviously I can't just call the <>.get() function in the options table directly -- it's fun but it just gives me the result of the <>.get function -- and I can't for the life of me find any type of refresh prompt, signal, call, semaphore, smoke signal, or kicked alley cat that would prompt an update.
Now, thankfully, I generate the options table dynamically and use shared, hidden keys in the data and the options table so it's trivial to find the leaf (or stem), prune it, and re-add it but that seems kinda drastic just to force a single-control re-calc (in testing, this is unobserved by the user even when the control/leaf/stem they are in is pruned/readded but that feels like a slow-timing issue with the blizzard options panel and may not work for all users/machines/addon-loads).
So...is there a way to pretty-please-with-sugar-on-top to get a 2nd-party element to recalculate its value?
(For background, my options table is set of nested, inline=false groups for the purpose of easy user access to controls (i.e., collapsible group of group groups) but this winds up with a control in
this group resetting the displayed name on
this group in a
group{group{group{group{group{controls}}}}} -type setup in one scenario.)