I'm trying to figure out how to update an open Ace3 options panel on demand. If I open my panel, I can change my db values with the interface, but when I change the values somewhere else the interface doesn't update to reflect the new value.
For example, I have a toggle button that shows the "movable" value of a bar. It works just fine in the interface. However, I can also change this value by shift+clicking on my bar frame (completely separate frame than the options frame). But, if I have the options frame open when I do this, the toggle will display the old value and doesn't update unless I reopen the frame.
I tried to use AceConfigRegistry's NotifyChange, but it doesn't seem to be doing what I expect.
Here's an example of a function that I use to set a value outside of the interface:
function addon:SetDBValue(dbType, info, value, ...)
info = type(info) == "table" and info[#info] or info
local db = self:GetDB(dbType, ...)
if not db then return end
db[info] = value
addonName is the same variable used for RegisterOptions.
This doesn't exactly cause an error or anything, it just doesn't update the interface. I'm not sure if maybe there's another function that I can't seem to find that can refresh the frame. Or perhaps there's another step I need to use NotifyChange?
I saw where someone said to use AceConfigDialog.OpenFrames["AppName"] to see if a frame is open, but the OpenFrames table is empty, even when I have my panel open. If this could work, I could just check if it's open, close it, then reopen it. But I feel like this would be overkill and there must be a simpler solution.
This returns an empty table, even when my options are open:
I'm not sure what other relevant code I need to share, so I apologize if I'm missing something.
Also, I just realized I may have posted this in the wrong forum. If a mod could move it, that would be cool. Or if it's ok, then no worries.
I originally wrote LibOptionsAssist to give me the ability to refresh my options. You can use it or look at the code to see how it works and apply it to your situation. Keep in mind I didn't know about NotifyChange at the time so I never tried to get that to work.
I found out what my problem was using the OpenFrames table. I was Opening my options into a container frame that I created, which I didn't need to use. So when I removed that frame and just opened it without the second parameter, my frame showed up in that table.
Final result was to simply check if the frame was open and if it was, call Open again to refresh it.