Form using HTML on PythonCard

Discussion in 'Python' started by Luiz Siqueira Neto, Jul 4, 2003.

  1. 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.
     
    Luiz Siqueira Neto, Jul 4, 2003
    #1
    1. Advertising

  2. Luiz Siqueira Neto

    Riccardo Guest

    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" <> wrote in message
    news:...
    > 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.
    >
     
    Riccardo, Jul 4, 2003
    #2
    1. Advertising

  3. Luiz Siqueira Neto

    Guest

    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 4, 2003
    #3
  4. Luiz Siqueira Neto

    Lee Harr Guest

    > 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.
     
    Lee Harr, Jul 4, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karl Lopes

    PythonCard newbie question

    Karl Lopes, Jul 13, 2003, in forum: Python
    Replies:
    1
    Views:
    401
    Kevin Altis
    Jul 13, 2003
  2. Ron Stephens
    Replies:
    0
    Views:
    364
    Ron Stephens
    Sep 13, 2003
  3. Kevin Altis

    ANN: PythonCard 0.7.2

    Kevin Altis, Sep 17, 2003, in forum: Python
    Replies:
    0
    Views:
    580
    Kevin Altis
    Sep 17, 2003
  4. Adrian Smith

    Pythoncard Multiple components

    Adrian Smith, Oct 8, 2003, in forum: Python
    Replies:
    2
    Views:
    398
    Andy Todd
    Oct 10, 2003
  5. Michal Lipinski

    problem with eval while using PythonCard

    Michal Lipinski, May 25, 2007, in forum: Python
    Replies:
    3
    Views:
    324
    7stud
    May 26, 2007
Loading...

Share This Page