After spending a lot of time putting together my UI, and then redoing it for a different resolution, and then having to keep 2 (or more) configurations, I've got this idea for an addon that manages your UI positioning.
It would allow you to create a table-like structure, and bind a frame to each cell. For instance, we have a root table, which spans the bottom part of the screen. Then we divide it in 4 parts, with second part taking up, say, 450px (for action bars/player/target frames), 4th part 200px (minimap), 1st bar 60% of the remaining space (chat) and 3rd bar taking up whats left (recount). Then you subdivide the second part vertically, and so on recursively until you have all the table cells you need. Then you bind chat frame to cell #1, and it will inherit that cell's size and position. Then you keep doing it for all frames. You could then, say, bind a kgpanel to root frame to make a background for your UI.
Since addon's don't really support anchoring their frames freely - e.g. bartender doesn't cause any problems if you anchor its frames to something else, but TellMeWhen keeps resetting its position from time to time. Perhaps I could look create special cases for such problematic addons, while using a general SetPoint solution for the rest of them.
Now, first of all I want to make sure I'm not wasting my time redoing something that already exists. And if anyone sees any particular problems I might not have thought of.
First, I think the idea is nice. But my best guess is that there will be a lot of addons that have issues. I know mine would. I occasionally call a "Restore Window Position" type call that's not necessarily done during OnLoad. Also, most of my frames aren't global (or rather, I don't provide a global name for it) or generated as needed, recycled, etc. So not sure what issues that might cause. If you manage to work it out in a reliable way I think it would be a nifty tool.
As I said, for problematic addons I'll be making special cases that change internal addon settings so when it does reset its position, it will be the one I want. I'm going to go through addons I'm using as well as some popular ones, and then anyone else could add code for addons they need.
Yes I've ran into frames not being accessible globally (e.g. fortexorcist bar). Do you think there is any reliable way to grab it? One option would be inserting a function into target addon source code, but then I'll have to rely on users being able to do that.
Or I could have the user mouse over the required frame and call getmousefocus, but then I can't store that frame after logout.. or can I?
About controlling frame's position, if the addon doesn't provide options to change their frames' positions (for good reasons), then we probably don't want to bind them to our frames grid. If they do, then we can probably change these settings on the fly so when those addons do reset their frames, nothing bad happens. About frames being recycled, eh, if I could get access "path" for that frame (e.g. Bartender4:GetModule("ActionBars").actionbars) and use it every time instead of storing a reference once, then recycling shouldn't break anything.
There's always a way to grab frames that don't have global names. Either access them through the addon's internal path for it (eg. Bartender4:GetModule("ActionBars").actionbars) or just iterate through all frames looking for known characterstics that will allow you to identify a particular frame.
I guess that works, but I don't see a way to define a set of characteristics if the user only chose a frame once by mousing over it. If its a known addon (e.g. fortexorcist) then those characteristics could be hardcoded, but if the user wants to select an arbitrary frame..
Either way there's a lot of work to do before I get to that issue.