GUI definition for web and desktop

Diez B. Roggisch deets at nospam.web.de
Sun Feb 3 08:59:44 EST 2008


Daniel Fetchinson schrieb:
> Hi pythoneans,
> 
> I'm looking for a simple text based GUI definition format and
> associated python modules to work with it that is capable of defining
> simple GUI's for *both* the web and the desktop. I have an application
> that is accessible through the web and also through desktop
> applications and both clients should be presented a simple dialog GUI.
> This dialog will only include text fields, radio buttons and a file
> upload field. The exact list of fields might change from time to time
> which implies that both clients should immediately know about it.
> 
> My idea is that if there was a lightweight GUI definition format then
> I would define the current list of fields and other GUI elements in
> this format, expose this file on the web, and both the web client and
> the desktop client would first fetch this file and generate the
> appropriate GUI from that dynamically. If the GUI changes I would only
> need to modify my definition file and both type of clients would
> immediately know about it since before they do anything else they grab
> this definition.
> 
> I haven't yet decided on the desktop client GUI library, it depends on
> which library has such a dynamically generatable interface from a text
> file. But it should be cross platform between linux and windows.
> 
> What would be the best way to do this?

Not doing it. Seriously, the problem lies not so much in rendering a 
simple GUI - but the event-system, including things like value-binding 
or whatever the principles behind the actual toolkit of choice are called.

Creating an abstraction that takes into account the
differences of both the toolkit and javascript/HTML/DOM is tedious.

That doesn't mean that you won't be able to produce a quick prototype. 
But the very moment you start getting serious, problems will crop up 
fast. And you'll end up with either something not working the same on 
both platforms, or with a very limited subset.

If you really want browser-delivered GUI, the old java applets might be 
a better choice - there at least the whole GUI + even-stuff is unified 
for stand-alone as well as embedded applets.

Diez



More information about the Python-list mailing list