Please point me in the right direction.

Since you are new to Perl, I will give you some tips. In any GUI, if you run a while loop( or sleep ) as you do in your code, you will interfere with the GUI's eventloop, which is the line $app->MainLoop; That will make the GUI freeze unless you manually update the mainwindow everytime thru the loop. You just can't mix conventional Perl code with GUI code, and expect it to run.

You can run a network while loop with a GUI front end, but the network loop must be in a separate thread. This however, is generally not a problem with GUI's because almost every GUI toolkit has a fileevent or IO watch method, which allows the GUI to watch the network without a while loop. I googled for it, and was surprised to read that Wxwidgets has no filehandle watch. See AnyEvent for a workaround. Maybe a Wx guru knows a better way.

To show how it should work, using Tk , see Re: hanged In Tk-socket program. In that server, I make the socket before the GUI pops up, and use a fileevent to handle incoming connections. This is probably the simplest example possible.

You might want to switch to Tk if you don't understand how Wx or GUI's work. For more complex Tk server-client pairs, see ztk-enchat encrypted server client and Tk encrypted echoing-chat client and server

Once you get the idea of how it is supposed to work with Tk, then you can go back and try to do the same thing with Wx. Sockets are not intuitively obvious to make run correctly.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Server with GUI by zentara
in thread Server with GUI by gg4000

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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, details, 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, summary, 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.