Building enhanced visual GUIs on the Windows NT Platform with Pythonwin
Pythons high runtime dynamic capabilities provide an ideal base platform to perform rapid development of graphical user interfaces. Ever since I ran across Python and Mark Hammonds Pythonwin one of my big wishes was to be able to develop Windows NT applications in Python, that support the GUI features and current look and feel as seen in the major Windows software packages. So eventually I decided to try to find a solution for this.
Based on Mark Hammonds Pythonwin a modified version of Pythonwin was created to support one of the leading third party MFC Visual C++ extension libraries. One of the main aims was to be able to program all features of a Windows application dynamically at runtime, without the dependency of having to create compiled resources, and needing to link them into Python dynamic link libraries (.pyds). At the C++ level support was added for creating resources for menus, form views and image lists out of Python tuples. This enables applications to quickly create all necessary GUI framework components for their display in Python, and its possible to take advantage of Pythons rapid speed of development for this area, too.
1.1. Supported Features
At the current stage of development support is available for many new and advanced features that are provided by the MFC extension library we chose. These include docking menu bars, docking windows, MDI alternatives for window management, etc. Furthermore several new dialog, tree and list controls, and a C++ backed dialog layout management, that provides fast window and control rearrangement when resizing a frame.
One disadvantage of choosing a commercial library was that we had to accept the fact, that due to licensing restrictions the interfaces to these extensions cant be distributed free of charge. Third Party licenses are required for developers. Nevertheless I think these extensions for Pythonwin prove, that Python is a competitive language for developing up to date GUI interfaces for Windows. Once again Python together with Pythonwin is one of the only alternative languages besides C++ that has the flexibility to support these kinds of features.
Furthermore by being very dynamic at runtime Python will help to simplify adding web browser like features and dynamic forms functionality to MFC style applications. With the expanding acceptance of Internet browser interfaces by users, this is an expectation that will be necessary to be supported by future user interfaces of non web-based applications as well.
Without Mark Hammonds Pythonwin for Visual C++ this naturally would never have been created, so a big thanks to Mark for developing such a great tool!
1.4. Copyright Notice
Pythonwin is Copyright Mark Hammond; Visual Python and Visual Python Edition is Copyright Ryan Hughes and Neuberger & Hughes GmbH; Python is Copyright Stichting Mathematisch Centrum, Amsterdam, The Netherlands; MFC, Visual C++, Windows NT are Trademarks of Microsoft Corp.
Figure 1: Pythonwin in action