469,579 Members | 1,076 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Form using HTML on PythonCard

Somebody know how make html forms or python forms inside html to use as gui
application?

The idea is make a client application like a web site of my interprise for
customers who don't have good connection, in this way the customer can select
the products off line and connect only to execute the shop. The use of HTML
is to have the same paradigm to application and to site.

Jul 18 '05 #1
3 2622
PythonCard is a wxWindows application, therefore you've got two choices:
1) use a wxHtmlWindow that can display *simple* html. Anyway I used it and I
don't think it can handle forms (but maybe I'm wrong). You'd need to extend
it a bit (it is a straightforward process see the wxp example in the
wxWindows demo)
2)if you are on windows you can use the wxHtmlIEWindow that renders html
using th WebBrowser COM component. The problem, then, is how to handle form
data. If you want to access them from python that can be troublesome.

Riccardo

"Luiz Siqueira Neto" <cy**********@mac.com> wrote in message
news:ma**********************************@python.o rg...
Somebody know how make html forms or python forms inside html to use as gui application?

The idea is make a client application like a web site of my interprise for
customers who don't have good connection, in this way the customer can select the products off line and connect only to execute the shop. The use of HTML is to have the same paradigm to application and to site.

Jul 18 '05 #2
You can put panels of widgets into HTML very nicely with wxPython.

The version of HTML that the wxHtmlCtrl supports is pretty simple,
but it includes a hook for extending it, the WXP tag. This looks
something like this embedded in your html:

<wxp module = "somemodule" class="SomeClass" width="95%">
<param name="id" value="-1"> </wxp>

Although the demo that comes with wxPython does something simple
like embedding a button, I just about always derive SomeClass from
wxPanel, and I use sizers to control the layout of several
controls within the panel. The constructor will start like this:

class SomeClass(wxPanel):
def __init__(self, parent, id=-1, size=wxDefaultSize)
wxPanel.__init__(self, parent, id, size=size)

IDK how to pass in object references as constructor parameters in the
embedded HTML, so these panels seem to often wind up using globals to
communicate with the rest of the program.

Keep in mind that the constructor for this panel is not called until
the HTML actually gets put into the wxHtmlCtrl (by SetPage, etc).
The panel also gets automatically destroyed when the next contents get
put into the wxHtmlCtrl, so don't hang on to any references to it.

IDK if PythonCard supports this control or not. Haven't used
pythoncard.

I alsways use wxCallAfter to send the next page to the wxHtmlCtrl.
That way I don't have to worry about a panel destroying itself while
its still running by changing the screen contents. wxCallAfter waits
until the current UI event is completely processed before doing
whatever it does.

This all leads to a pretty convenient style of programming. I throw
something at the screen, the user clicks something, maybe this makes
me throw something else at the screen, maybe it doesn't. If not,
he's still got the same screen to try something else. You don't
have to work out a hierarchy of screens where the user is forever
drilling down and popping up -- they can have more browser-like
freedom. Makes their heads spin. Keep a copy of the HTML and give
them a back button.
Al
Jul 18 '05 #3
> Somebody know how make html forms or python forms inside html to use as gui
application?

The idea is make a client application like a web site of my interprise for
customers who don't have good connection, in this way the customer can select
the products off line and connect only to execute the shop. The use of HTML
is to have the same paradigm to application and to site.


How about starting a simple webserver / proxy on their machine?

You could just connect to that, and if their connection is up
forward the information on to your real server.
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ron Stephens | last post: by
reply views Thread by Werner Merkl | last post: by
1 post views Thread by jlocc | last post: by
1 post views Thread by Brandon McGinty | last post: by
4 posts views Thread by Tequila | last post: by
8 posts views Thread by king kikapu | last post: by
8 posts views Thread by Kevin Walzer | last post: by
1 post views Thread by bvidinli | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.