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
In reply to Perl GTK2 with Perl Threads by sam_bakki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |