I don't use Win32, but try Install GTK2 or gtk2-win32 support Glib is the base library for Gtk2. It does not need a gui and is developed to be thread-safe( as demonstrated by my previous example). I would be willing to bet that Event.pm is not thread-safe. The author talks alot about threads in the Event.pm perldoc, but never mentions the thread-safety of Event.pm So I'm willing to bet it acts like Tk, and you have to start the threads before any Tk code is called.... I generally use a "sleeping thread" where I have a thread code block controlled by a $go shared variable. That way you can use Event, by starting the thread before any Event code is written, then in your create_thread callback, just
set $go to 1 to get the thread running. If you need help on how to do that, just use the SuperSearch for "Tk threads" and you will find many examples of a sleeping thread.
This is from the Perl/Gtk2 maillist:
From: Gabor Szabo <szabgab@gmail.com>
For ActiveState users
* I assume you already have ActiveState Perl installed on your system.
If not, download and install ActiveState Perl from
http://activestate.com/Products/ActivePerl/
* Next you need to install the GTK+ 2.x.x runtime environment. The
latest version can be downloaded from
http://gimp-win.sourceforge.net/stable.html
* Ensure that the <INSTALL_PATH>\GTK\2.0\bin directory is in your
PATH after this installation.
* Next you need to install the Win32 binary packages for gtk2-perl.
Download and install the latest version of Gtk2.ppd and Glib.ppd from
http://gtk2-perl.sourceforge.net/win32/ppm/
(Another way to install these ppds is as follows
C:\Temp> ppm install http://gtk2-perl.sourceforge.net/win32/ppm/Gtk2.p
+pd
C:\Temp> ppm install http://gtk2-perl.sourceforge.net/win32/ppm/Glib.p
+pd
)
Your system should be ready to roll !
|