Accessibility
Bruce Eckel

Bruce Eckel

mindview.net

Table of Contents

Created:
16 July 2007
User Level:
Intermediate
Products:
Flex

Put a Flex UI on your application

Note: This article was created based on Flex 2. Minor changes in the description and code may be necessary before it can be applied to Flex 3.

I have been a Python enthusiast for over ten years. Its power and expressiveness has made it my first choice when solving my own programming problems, however, whenever I've wanted to create a program with a user interface—an end-user application, for example—I've had problems. There have always been too many choices for Python GUI libraries, and each one has its own idiosyncrasies. I've studied most of them to one degree or another and over time WxPython (based on WxWindows) seems to keep pulling in front of the pack, but in my own experience I've found it far from the ideal solution. Mostly it seems like too much work, which is true for most of the Python GUI libraries.

The more I work with it, the more I find Adobe Flex to be preferable to any other GUI solution that I've explored. As I learn more about ActionScript, too, I gain greater appreciation for all the effort invested by the designers of that language to make life easy for the programmer. The combination of MXML and ActionScript is amazingly well balanced; MXML keeps you at the "big picture" level most of the time, and you can easily drop down into ActionScript to gain detailed control. Flex was designed with user interfaces at the forefront, so it includes true properties and events as well as data binding to automatically move data from one place to another when something changes. Features like this never made it into Java.

Try combining the power of Python with the polish of Adobe Flash to create a desktop application. Using this approach will also work with any language that has support for creating an XML-RPC server (Java, Ruby, C++, to name a few). Also, the XML-RPC server can be on another machine.

And then there's Adobe Flex Builder. Built on top of Eclipse, Flex Builder provides an incredibly powerful development environment with auto completion, integrated help, debugging, and more. I haven't seen support for any of the Python GUI libraries that even comes close.

Requirements

To complete this tutorial you will need to install the following software and files:

Adobe Flex SDK and Flex Builder

About the author

Bruce Eckel is the author of numerous books and articles about computer programming. He gives frequent lectures and seminars for computer programmers, and was a founding member of the ANSI/ISO C++ standard committee. His best known works are Thinking in Java and Thinking in C++, aimed at programmers with little object-oriented programming experience. Most reviewers consider these books to be better written and more pedagogic than most introductory texts on Java or C++. He has since made both books available for all to download freely. However, his recent book, Thinking in Java, Fourth Edition, is no longer available in a free, electronic form.