(Context for this post, is loading a pyui file into a class, hence creating a custom class (ui.View) with the pyui becoming the root of the class. Example gist, https://gist.github.com/c24156294c220668270d)
It was @JonB that got this working with bindings etc... @omz, I hope you can include this functionality into the ui package when you have time.
@omz, I think it would be great if for every ui elem in a pyui file (well in the ui designer ) had a switch to say that item's name would be added to a custom class as an attribute. Basically to provide a flattened out mapping. You can do it by hand, but it's time consuming And messy. I can see I can do some neat tricks with the custom attributes, like calling methods on self In the dict def of the custom attr. It's very nice But still a lot of hard coding. But that feature is still very cool anyway. But this seems like it should be native to me. No need for tricks etc.
In the designer, you really want to nest your ui elements Into custom views (deeply). But when it comes to the coding side, you want more of a flat representation of the ui elements. Maybe a attr is to much. Could possibly be a single attr with a dependency dict, containing ui.names with object instances or more....
Another great feature, would be if in the ui designer you could do a link to another object. Graphically or text entry (the ui object name). Then you would add another std attr to each ui elem obj like obj_ref or whatever, that would be populated with the instance var of the object referred to. The idea being that you could use that object's geometry as a parent when it comes to resizing. Hmmm, well that probably will not work itself. But if there was a editable index number for each item, by default just increment, but also editable. But if you relied on ordered redrawing in Layout, you could for example get a list of the items that need to be resized in the layout method, in order (I.e by index ) meaning if you have sizing dependencies you could calculate and size them in order. Maybe my implementation suggestion is infantile, but the idea is there. A more complete suggestion I think would be a flex ability to another ui object. Possibly even easier to implement, I am not sure. But I was trying to contain myself. :)
Again, I know there are ways to work around these issues, but I think more code that's part of the std api the better.