Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

How to write standalone HTML GUI?

by chunlou (Curate)
on Sep 10, 2002 at 06:07 UTC ( #196561=categorized question: print w/replies, xml ) Need Help??
Contributed by chunlou on Sep 10, 2002 at 06:07 UTC
Q&A  > GUI Programming


Description:

Is it possible to write a standalone GUI in HTML/DHTML (i.e. just using web browser, no web server) to execute Perl scripts?

For example, have a web page with a bunch of links to my Perl scripts, which I can click and execute, and see the script's output in the browser, without resorting to web server and CGI. Rather like a standalone browser-based shell.

It seems easier to me to write a GUI in HTML than Tk, plus you get CSS stylability and all that.

Answer: How to write standalone HTML GUI?
contributed by grantm

If you install ActivePerl on windows, you can use PerlScript in IE from <script> tags in static HTML pages the same way you use JavaScript (or VB Script). Not cross platform and IE only.

Another option would be to use Perl as a web server. Check out HTTP::Daemon for one example.

Answer: How to write standalone HTML GUI?
contributed by dimar

Related to the previous answer: you can make HTML Applications (HTA) with ActiveState PerlScript. An HTML Application is an HTML page which runs in the same security context as an 'exe' file.

<script language="perlscript"> ## perl goes here </script>

Again, this is not cross platform and is IE only.

Also see the Perl-Win32-ASP FAQ

Answer: How to write standalone HTML GUI?
contributed by igoryonya

You could use Mozilla XUL, which is HTML(XML)/JavaScript User Interface. I am not sure if it works in conjunction with perl, since, I've several times started learning XUL, but every time got distracted by other problems in life. ...but it will only work in browsers, based on Gecko engine, unless something has changed since then.

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [Corion]: choroba: No, I don't remember that story, but yes, it matches my experience ;))
    [ambrus]: Hopefull the object isn't kept alive, the events are processed immediately, but you'd have to read a lot of source code to be sure about that.
    [Corion]: ambrus: I think both of AnyEvent and Prima are pretty tight in their memory management because they both are cooperative multitasking and (I think) both use the Perl memory management for managing things
    [Corion]: ambrus: And for Windows, I don't think that Prima knows if there still are messages queued for an object (in the Windows message loop). Finding that out would take lots of effort for little gain
    [ambrus]: And even if this works, I'm still not sure you can't get double timeouts from a Timer.
    [ambrus]: Corion: well Prima::Object says something like that the cleanup method will send an onDestory message and that you can't get more messages after cleanup, or something.
    [Corion]: ambrus: Yeah - I don't think the deep source dive will be necessary if things are implemented as simple as they could be :)) And hopefully I won't need (more) timely object destruction. I can update the screen at 60Hz and hopefully even do HTTP ...
    [Corion]: ... transfers in the background. Now that I think about it, this maybe even means that I can run the OpenGL filters on Youtube input :)
    [ambrus]: Corion: I mentioned that the unix event loop of Prima always wakes up at least once every 0.2 seconds. Have you found out whether the win32 event loop of Prima does that too?
    [Corion]: ambrus: Hmm - I would assume that the onDestroy message is sent from the destructor and doesn't go through the messageloop, but maybe it is sent when a window gets destroyed but all components are still alive...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (8)
    As of 2016-12-09 10:25 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      On a regular basis, I'm most likely to spy upon:













      Results (150 votes). Check out past polls.