Right now I'm working on my first big GUI project (with SWT, naturally),
and I'm finding that the code gets very cluttered very quickly.
It's easy to get pages and pages of purely procedural code without hardly
trying. I've been grouping many of the common tasks into arrays and such,
but there's still so much. Is there a good way to apply OOP principles (or
anything) to clean up tons of GUI code?
For example, I've got right-click menus that open property windows. I had
tried to abstract the right-click menus into a separate class. However, I
found that I eventually needed a Display, Shell, etc., so I had to pass
these things into the objects when they were instantiated, and it just
seemed to add to the confusion without helping the clutter.
My backend is pretty well-organized (IMO), but my GUI code is just
horrendous. I was just wondering if anyone had any tips on how the pros do
it.