[BioPython] Developing GNOME Applications with Gnome-Python

Andrew Dalke dalke@acm.org
Thu, 25 May 2000 22:11:19 -0600


Jeff Bizzaro <bizzaro@geoserve.net> wrote:
> Gnome is a desktop system based on C/Gtk (a GNU widget set), among
> other things.  There are successful ports of C/Gtk to Windows, BeOS and
> I think OS/2 (not to mention every Unix flavor).  Python/Gtk for Windows
> also exists.


But the GTK for Windows download page at
  http://user.sgic.fi/~tml/gimp/win32/downloads.html
says "Even if the GIMP for Windows can't be said to be ready for
end-users,".
I know the port has been available for about 1.5 years, so the current
state likely says something about the level of support for it.


>I'm not so sure about Gnome on Windows.  Windows of course has its own
>desktop, so there may not be much interest in doing the port.


Gnome for MS Windows does not exist.  The page
  http://www.gnome.org/intro/findout.html
says things like:
] The GNOME development platform: a rich collection of tools, libraries,
] and components to develop powerful applications on Unix.


> If platform independence is important, go with vanilla Gtk and not
> Gnome.  Python/Tkinter is still more ubiquitous, but it is slower
> than Python/Gtk and hoplessly tied to Tcl/Tk.  There is also wxPython,
> but I don't have experience with it.

Hmmm... and Gtk is hopelessly tied to C? :)

Seriously, I think the current state of GUIs for Python is that there is
no best choice for GUIs.  The major decisions are:

 Which OS?
   only unix == wxPython or GTK
   only MS Windows (eg, needing ActiveX support) == wxPython or MFC
   MS Windows or unix == wxPython or Tkinter
   MS Windows or unix or MacOS == Tkinter
   MacOS and anything else == Tkinter

 How much native look and feel for different platforms?  If a lot,
then wxPython is a better choice for X and MS Windows along with
Tkinter.

  Do you need a good canvas object?  Tkinter is the best solution there.

  How stable should the API be?  I understand wxWindows' API changes
quite a bit between versions.  I know one place who developed their own
API on top of wxPython's to insulate themselves better.  Tkinter's is
rock solid.  I think GTK's is pretty well established.

  How much interaction do you want with the local environment?  I want
to take a serious look at what can be done with GNOME components for
bio&chem, so gtk is the best solution - but maybe wxPython allows access
to the gtk parts of things?  For MS Windows, wxPython is pretty good
at working with other MS Windows codes (eg, you can embed ActiveX inside
a wxWindows display).  On the other hand, Visual Basic is very good at
that, so a pure Windows solution could use VB for the interface and
Python for backend COM components.  (That's best if the GUI is mostly
menus, forms, etc.  For 3D GUIs, like structure visualization, I would
use Python.)

  How much documentation do you want?  Tkinter has a lot.  Gtk's is
growing (eg, there's a book out now, or at least soon), but in Dr.
Dobb's a couple of months ago, the said that a lot of the more complicated
or interesting stuff is still missing.  wxPython's is okay, but again
it isn't fully documented.

  There are other choices, like Qt.  Don't know about that toolkit and
don't know of anyone using the Python bindings for it.  FLTK runs on MS
Windows and X, but doesn't provide native feel for either system and
doesn't have a very fancy widget set (but still good enough for VMD, a
molecular viz. program I helped develop).

  Bioreason (where I used to work) uses GTK for Unix.  I mentioned
another site using wxPython and they developed GUIs for MS Windows.
Neither distribute their prorgrams so they don't need to worry about
multiple platforms.  Both were happy about it the GUI toolkit.  Guido
uses Tkinter and is worried about multiple platform support.

  If I were doing biopython for commercial reasons, I would most likely
choose wxPython because it does have good MS Windows support (where the
money is) and does run well under Unix (where my heart is).  If I
were doing it for the cool technology factor, I would choose gtk because
of the GNOME support.  If I were doing it for widest possible use, I
would use Tkinter.  As it is, I'm not doing GUIs, so I don't have
to decide :)

  Not much help, was I?  Okay, then my final statement is that I've
found that the GUI is not that large a part of applications I've worked
on, and can be written in such a way that different GUIs can be used
with only minimal change to the internals.  So it doesn't matter much
what you choose.

                    Andrew
                    dalke@acm.org