Hi Great Monks,

perlmonks.org is a great place for perl lovers to learn and share. I have learn many things from this site, Now I am here to share.

A month ago, I started looking for GUI development in perl. Since I was familer with Visual Basic , I also wanted good GUI editor and latest , stable tool kid. Based on many other criterias, I chose Perl GTK2.
With using Gtk2::GladeXML, You can create simple GUI applications so fast but real problem arise when you have an application with Threads.
Since Perl threads and perl Gtk2 will not go better , I had to dig out a lot for making things work.


1. Never create / Call any GTK2 objects in perl threads.
2. Re structure you app in such a way that , IN main thread you will create GTK2 objects and in other threads should do some work and put the results in some Q
3. Using GLib::Idle->add(), you can keep pool the result Q and update the GUI.
4. use Thread::Queue

This model works very well for me. I have created web spider application (initial version but working condition) with GTK2 GUI front end.

http://code.google.com/p/saaral-soft-search-spider/

Since it is big code (with 2 modules), I do not want to paste it here.

Please see : http://code.google.com/p/saaral-soft-search-spider/source/browse/#svn%2Ftrunk

Thanks
Bakkiaraj M

In reply to Perl GTK2 with Perl Threads by sam_bakki

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.