How to used Gtk2::GladeXML????



All,

I am come up with the trouble, had the failed like:
---------- perl ----------

(wperl.exe:3264): libglade-WARNING **: could not find glade file 'hello.glade'
Can't call method "signal_autoconnect_from_package" on an undefined value at D:\work_station\new_gtk\hello1.pl line 10.

My scripts is :
1.hello.pl
#!F:/Perl/bin/perl.exe -w

use strict;
use warnings;

# for a pure gtk+ glade project
use Gtk2 -init;
use Gtk2::GladeXML;
my $gladexml = Gtk2::GladeXML->new('hello.glade');
$gladexml->signal_autoconnect_from_package('main');
my $quitbtn = $gladexml->get_widget('Quit');
Gtk2->main;

2. hello.glade
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.3 on Fri Jun 27 15:30:05 2008 -->
<glade-interface>
  <widget class="GtkWindow" id="window1">
    <property name="title" translatable="yes">hello world</property>
    <child>
      <widget class="GtkButton" id="button1">
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="receives_default">True</property>
        <property name="label" translatable="yes">hello world</property>
        <property name="response_id">0</property>
      </widget>
    </child>
  </widget>
</glade-interface>

So, Why it? How to fix it?
Andy ideas?

Thanks,
Air
--
Linux>>>>>still>>>>perl

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]