Time to reimplement Vision2
I have been using Vision2 a lot over the past 5 years across a number of projects and have become aware of many idiosyncrasies in it's behavior between the GTK and Windows implementation, that make it difficult to have consistent behavior in your application. This is especially true if you want to develop any kind of customized component but even some quite basic things have inconsistent behavior.
Examples of custom components
- Buttons based on SVG graphics with roll over highlighting and customizable click animations.
- Boxes with auto-hiding on selected member widgets. When you roll the cursor over the box, various hidden widgets reappear, and disappear again when the cursor leaves.
- Labels with a pixmap-able background based on drawing areas.
- Hyper-link labels based on drawing areas.
- Color selection buttons.
- Drawing areas that can adapt their own size to an expanded parent cell.
Examples of basic inconsistencies
- Pixmap have a different expansion status in Windows then under GTK necessitating an explicit set_minimum_size call.
- Scrolling areas don't respond to the usual keyboard shortcuts in Windows. I made my own Windows implementation based on the standard one. It's ok, but not without side effects that have to be worked around. Recently I had a case of child buttons that wouldn't respond.
- The web browser component in Windows prevents processing of keyboard accelerators.
The typical Vision2 cross platform development cycle consists of developing some new functionality on Linux and after recompiling your project in Windows, you find that a component is either: not visible, not aligned properly, has the wrong expansion status, is partially obscured, won't respond to the usual keyboard shortcut, breaks a contract, or even crashes the application. You then spend some time finding workarounds and then go back into Linux to see if your application still works the same there. In some cases I have spent days trying to get a custom component to work consistently on both platforms.
Vision2 has had a long history (15+ years) but it is still far from perfect. This I believe is a reflection of the fundamental difficulty of developing a totally consistent GUI interface based on incompatible toolkits.
However it doesn't have to be like that. For quite some time now, it has been possible to develop GTK+ applications that run on Windows, Mac OS and mobile devices. (Screen shots) And not just relatively simple apps like Gedit, but very complex ones like GIMP or InkScape.
Now that Eiffel Software have sanctioned the mingw as the default C compiler distributed with EiffelStudio, perhaps now is the time to jettison the Win API part of Vision2 and base it entirely on GTK+. (In fact you can still use the MS compiler for GTK+) The main advantages of an entirely GTK+ based toolkit are as follows:
- Ensures completely consistent cross platform behavior.
- Maintenance and bug fixing becomes much easier due to reduced complexity.
- Addition of new GTK+ components is easier as you don't need to look for an Windows equivalent.
- Reducing the complexity of creating custom components encourages more Eiffel developers to experiment and contribute new things. Making new widgets using only the top level interface is far easier than struggling with two very different C API's.
- Reduces the likelihood of problems using mingw as the default C compiler.
What do people think?