Here are a couple of small things you can do to make yourself more productive w/o reinventing the whole way to do maya gui…
-
Write a wrapper for formLayout. It’s the most useful and flexbile layout but also the biggest pain in the ass to write for. So, code up a little class that wraps a formlayout with some syntax sugar and commonly used cases.
-
Learn Maya UI templates. A lot of what you want in terms of simplification and avoiding boilerplates can be gotten with templates.
-
Study up on the Model-View-Controller (MVC) and Model-View-ViewModel (MVVM) patterns. They are common in things like QT or WPF apps, not so much in Python although our own @yasin has a tutorial on youtube on this very subject. A lot of complex UI boils down to picking the right display template for a piece of data. In our world the template is just a function that takes a data object and a produces some UI that works on that object – you can mass produce them for lists or have them be one-offs; the surrounding code won’t care. With an MVC framework in place you can split your display code and your functional code more cleanly than the normal maya style, and noodle on either end without disturbing the other.
If after all that it still looks like too much, maybe consider getting PyQT designer and doing your UI declaratively that way; then “all” you have to do is hook up the events and go.
Of course, all GUI programming is a pain in the ass. If there is a magic way around it I’d sure like to know too 