Form using HTML on PythonCard

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luiz Siqueira Neto

    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.

  • Riccardo

    #2
    Re: Form using HTML on PythonCard

    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" <cybersamurai@m ac.com> wrote in message
    news:mailman.10 57322477.18286. [email protected] ...[color=blue]
    > Somebody know how make html forms or python forms inside html to use as[/color]
    gui[color=blue]
    > 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[/color]
    select[color=blue]
    > the products off line and connect only to execute the shop. The use of[/color]
    HTML[color=blue]
    > is to have the same paradigm to application and to site.
    >[/color]


    Comment

    • achrist@easystreet.com

      #3
      Re: Form using HTML on PythonCard

      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="SomeClas s" 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(wxPan el):
      def __init__(self, parent, id=-1, size=wxDefaultS ize)
      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

      Comment

      • Lee Harr

        #4
        Re: Form using HTML on PythonCard

        > Somebody know how make html forms or python forms inside html to use as gui[color=blue]
        > 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.
        >[/color]

        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.


        Comment

        Working...