I am attempting to use Gtk2 to create a user interface with Perl.
I have installed the various dependencies as described in the GTK Perl Tutorial, and continue to be unsucessful. Here is the test code.
use Gtk; # load the Gtk-Perl module use strict; # a good idea for all
+non-trivial Perl scripts
set_locale Gtk; # internationalize
init Gtk; # initialize Gtk-Perl
# convenience variables for true and false
my $false = 0;
my $true = 1;
# widget creation
my $window = new Gtk::Window( "toplevel" );
my $button = new Gtk::Button( "Goodbye World" );
# callback registration
$window->signal_connect( "delete_event", \&CloseAppWindow );
$button->signal_connect( "clicked", \&CloseAppWindow );
# show button
# set window attributes and show it
$window->border_width( 15 );
$window->add( $button );
# Gtk event loop
# Should never get here
exit( 0 );
### Callback function to close the window
Gtk->exit( 0 );
# END EXAMPLE PROGRAM
When I run this I get the error message
"Can't locate loadable object for module Glib in @INC (@INC contains: /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /System/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/Updates/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level .) at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/Gtk.pm line 30
Compilation failed in require at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/Gtk.pm line 30.
BEGIN failed--compilation aborted at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/Gtk.pm line 30.
Compilation failed in require at GTK1.pl line 16.
BEGIN failed--compilation aborted at GTK1.pl line 16."
The executable modules for everything suggested by the tutorial.
Can anyone help me on this ??
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||