![]() |
Linux GUI Application Development for Windows Programmers December 1, 2002 |
|
Moving from windows to linux development you are confronted
with a myriad of options. QT vs GTK+? Which language should I use:
c/c++/java/perl/tcl/python/ruby or javascript? Should I use a
commercial/proprietary layout/rad tool (QT or Kylix) or an open source
one? What about Mozilla? My background was primarily in programming
Visual Basic and Lotus Notes(Basic, Java, c/c++ api). Where should I start?
Tool Selection I looked at TK(2), GTK+(3), QT(4), wxWindows(5), MFC, Windows Forms (.NET), Swing (Java), and FOX(6) and came up with the following criteria for tool evaluation.
Avoiding Proprietary Solutions Three or four options flouted to the top. QT and Kylix both offer nice, fairly easy to use RAD environments. However, I have used FoxPro and Lotus Notes - and am quite weary of proprietary solutions(both had Unix client support and then dropped it). Lock-in can happen later on in application use- when you don't even know it or expect it. Software companies can decide to change direction and no longer invest in your tool - and your application either stalls or dies. If you develop an open source app with QT - you are locked in to keeping the code open. Expensive licenses may be required for porting the code to Mac or Windows. Some companies and tools (Java & Notes) limit your right to distribute your code without additional licensing fees. I like Native look-and-feel GTK+ & TK felt too clunky for me under windows and I would like the option of running whatever I write in windows or mac. Let's face it - most users are used to using native widget sets and typically evaluate applications on appearance. If you want to stick to Unix style platforms GTK+ & pyGTK are good choices. Mozilla - XUL Another option that seemed intriguing is XUL - the xml code that forms the basis for the Mozilla gui. Benefits include - a cross platform widget set(1) and the ability to install via a browser (.xpi files) or run it directly from a server ( xulplanet has a nice tutorial). I discovered protozilla - which gives a way of running local cgi scripts or using ipc (pipes) - but it seemed unstable. I also found that you can access COM Objects via the IDispatch interface. The code is currently turned off and is not part of any Mozilla build. It is also very green code and not thoroughly tested. from a mailing list:The instability of mozilla as a development platform that had me put it aside - this could change in the future. wxWindows wxWindows is an open source c++ toolkit that acts as a thin wrapper around the native widget sets - GTK+, WIN32, Mac OS, Motif and others. It has interfaces for c++, perl, python & ruby. I like the idea of a widget set(1) that is a thin wrapper around others - thereby protecting you from changes and allowing cross platform development. I initially had problems getting wxPython running under Linux - the python incarnation of wxWindows, but Robin Dunn improved the install for Linux - and it is now available as an easy to install rpm. wxPython was created by Robin, who took swig, a tool which helps automate the creation of python classes from C or C++ APIs and created wxPython - the python interface to wxWindows. There are also interfaces for Perl & Ruby for those who prefer those languages. Another bonus is the ability to use XML to define the interface (like GTK+, QT, XUL allow). In theory this allows one to separate the description of the display from the logic of the display. Also I might like to programmatically create the display to speed up development. On the downside, although there are lots of example code snippets, available tutorials are far and few between, most of the documentation is targeted at C++ programmers, and the Mac OS X port is not complete. Finally I like to ask, "What are people smarter than me using?" Open Source Applications Foundation have decided on using wxPython after a year of thought GNU Entreprise - are using wxPython as the basis for the client server application many other organizations are using wxWindows in one form or another Now which tools should I use for Layout? wxDesigner:
one of the most complete but is closed source commercialware Somewhat focused on C++ development I don't like having to use their editor outputs xml, python, c++, or perl code Good, cheap, and stable - developed by one of the wxWindows developers. wxGlade: my new favorite - copying the best features of glade. Easy to use and extend. Not a full rad - more of a screen drawer. outputs xml, c++ or python code nice tutorial Actively developed PythonCard: Nice if you want to make simple quick app. I find this kind of tool causes people to put the business logic in the gui though. Speeds development by simplifying the event model. Outputs python code No option for xml output - but this may be coming soon Actively Developed XRC: Simple xml widget editor Boa: IDE I have heard good things and have played with it a bit - 0.14 is here GNU Enterprise Form Developer Not really stable yet - but looks promising. Choosing a Text Editor The most popular Python text editors are emacs, vi , and nedit, idle. I use editplus under windows (with idle) and emacs, nedit , and vi under linux. But many choices are available. If having the text editor separate from the screen drawing tool is foreign to you - try it - you might like it. If not boa or wxDesigner may be more your style. For application distribution you can use freeze so the user doesn't need the python interpreter installed. For application distribution there is Inno for windows and rpm or python setup.py for Linux & Mac. In the next segment I will go through a basic tutorial on application development with wxPython (1) Widgets - called controls in windows are items in your gui - check boxes - text tables etc (2) TK - From the tkinter toolkit - developed by Sun (3) GTK+ is the widget set that forms the basis of gnome in Linux (4) QT is the widget set that forms the basis for kde - it is owned by Trolltech (5) wxWindows is a widget set that is a layer over native widgets (6) FOX is another toolkit like wxWindows - popular with Ruby users Resources http://www.python.org http://wxPython.org http://www.wxWindows.org http://wxglade.sourceforge.net/ wxDesigner A list of available frameworks |
|