[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: GUI definition for web and desktop

Daniel Fetchinson

2/3/2008 6:33:00 PM

> >> >> > I'm looking for a simple text based GUI definition format and
> >>
> >> [...]
> >>
> >>>> I believe Glade produces XML descriptions of its interfaces, so wxGlade
> >> >> would be one possible starting-point.
> >> >>
> >> >
> >> > Glade does, but dont confuse it with wxGlade. wxGlade can generate
> >> > direct python code or XRC files.
> >> >
> >>
> >> So what are you telling me - that XRC files aren't XML?
> >>
> >
> > Im telling you to not confuse its format with Glade's format. Both are
> > xml, but are different things.
> >
> Thanks. My original advice still stands.

Thanks everyone for the advice!

It's clear to me that the logic behind a web interface and a desktop
interface are two totally different things. I don't want a magic
method to convert an html/javascript based web app to a desktop app as
this is clearly impossible.

But if both interfaces a specific component, which in the desktop case
is a dialog window, in the web app case a particular page and in both
cases the component is simply a list of text fields, radio buttons and
file selection button then it makes sense to have code that can be
used for both concerning the presentation only. So no business logic,
only the presentation, something that says "we have 3 text fields with
these labels and a radio button with such and such labels". Such a
definition makes perfect sense for both a web app and a desktop app
regardless of the fact that they work totally differently.

If I don't have such a shared widget definition then I have to update
both the web app (which is done using turbogears so essentially python
code) and the desktop app (also python) separately when new text
fields are introduced so they constantly have to be in sync. That is
error prone and will surely introduce bugs.
2 Answers

Jorge Godoy

2/3/2008 6:55:00 PM

0

Daniel Fetchinson wrote:

> It's clear to me that the logic behind a web interface and a desktop
> interface are two totally different things. I don't want a magic
> method to convert an html/javascript based web app to a desktop app as
> this is clearly impossible.

But it is not impossible to embed a server on your desktop and make it
render HTML on some windows. Then you'd have to code just the web app and
the desktop would also use it...

If Internet is a requirement, you can even render the HTML from a remote
server.

Daniel Fetchinson

2/3/2008 7:11:00 PM

0

> > It's clear to me that the logic behind a web interface and a desktop
> > interface are two totally different things. I don't want a magic
> > method to convert an html/javascript based web app to a desktop app as
> > this is clearly impossible.
>
> But it is not impossible to embed a server on your desktop and make it
> render HTML on some windows.

That's true, that is why I'm looking for a format that is
html/javascript/desktop/guitoolkit agnostic. It's ideally simply a
text file listing the widgets in whatever format (xml, plain text,
json, etc). And the python web app takes this file, parses it and
spits out the right html/javascript while the desktop app takes the
same file, parses it, and spits out GUI-toolkit specific code that
renders a window with those widgets using the GUI-toolkit in question.
The web app code that spits out html and the desktop app code that
renders a dialog window are different and have to be maintained
separately but the *definition file* can be shared.

> Then you'd have to code just the web app and
> the desktop would also use it...
>
> If Internet is a requirement, you can even render the HTML from a remote
> server.

The internet is assumed to be accessible so this is an interesting
possibility what you mention. Which GUI toolkit would be able to do
this? And so it would work in a way that the desktop app grabs an html
page and renders that in a dialog window? If this was possible then
maybe this would solve all my problems.

Thanks,
Daniel