Wheel-reinvention with Python

Cliff Wells cliff at develix.com
Mon Aug 1 17:37:41 EDT 2005


On Mon, 2005-08-01 at 14:13 -0700, Paul Rubin wrote:
> Cliff Wells <cliff at develix.com> writes:
> > Still, that leaves Linux and Mac out in the cold.  But I'll admit you
> > met my challenge.  Most likely you can actually do most of the things
> > with Tk you can with Wx, it's simply a matter of how much effort is
> > going to be (for instance, it's certainly quite possible to embed Gecko
> > in Tk, but I for one am not likely to be up to the task).
> 
> I actually misunderstood your question about embedding a browser and
> thought for a while about what it would take to write or port a
> serious browser to use tkinter as its graphics layer.  The resulting
> picture wasn't pretty.  I wonder whether it's feasible in wxpython.

wxPython has a toy HTML renderer that allows embedding wxPython widgets
directly into it.  If you only need simple HTML it works great.  It is
also possible to embed IE, Safari and Mozilla (via wxMozilla) but you
lose the ability to embed the wxPython widgets).

> I like the idea of a browser-like portable gui toolkit.  Instead of
> merely wrapping some other widget set, you'd write your interface as
> an XML file using HTML-like interface elements.  You'd have callbacks
> on the form submit buttons and optionally on the other input elements,
> and you could get at the elements through the XML DOM if you were so
> inclined (sort of like the HTML DOM that browsers expose through
> Javascript).  Implementations could run on top of Tk, GTK, native
> Windows widgets, or whatever.  

Actually wxPython has this today (and has had for some time): you can
build your interface code in XML and wxPython will build the interface
on the fly.  I played with it once as a method of building a dialog
editor along the lines of VB, but the project I needed it for died and I
didn't have time to finish.  My discovery was that it was entirely
doable though, had I had time to finish.

In fact, with the XRC stuff in wxPython, you can even create custom
controls with pure XML.  I'm not sure how great this is for hand-built
interfaces (but I haven't tried), but it seems ideal for automated
generation of GUI's.


Regards,
Cliff


-- 
cliff at develix.com
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and Python specialists ::





More information about the Python-list mailing list