hakim-djz has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I am trying to develop a Gui on Glade and building it with Perl. I've been following this tutorial http://blog.borovsak.si/2009/09/glade3-tutorial-1-introduction.html where I reached as far as the second part as I could not compile it in C or Perl.
When building with Perl I tried the following which I found from https://github.com/dave-theunsub/gtk3-perl-demos/blob/master/builder.pl
#!/usr/bin/perl use strict; use warnings; use Gtk3 '-init'; #use File::Basename 'dirname'; my $builder = Gtk3::Builder->new(); $builder->add_from_file("/home/hakim/project/tut.ui"); my $window = $builder->get_object('window1'); $builder->connect_signals( undef ); $window->set_screen( $window->get_screen() ); $window->signal_connect( destroy => sub { Gtk3->main_quit } ); $window->show_all(); Gtk3->main(); sub about_activate { my $about_dialog = $builder->get_object('aboutdialog1'); $about_dialog->run(); $about_dialog->hide(); } sub quit_activate { my $action = shift; my $window = $builder->get_object('window1'); $window->destroy; }
Can't call method "get_screen" on an undefined value at tut.pl line 21 is the error message I get from running it. If anyone can help it would be great
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't call method "get_screen" on an undefined value
by kennethk (Abbot) on Mar 06, 2014 at 15:44 UTC | |
by hakim-djz (Novice) on Mar 13, 2014 at 10:46 UTC | |
|
Re: Can't call method "get_screen" on an undefined value
by zentara (Cardinal) on Mar 07, 2014 at 11:18 UTC | |
|
Re: Can't call method "get_screen" on an undefined value
by zentara (Cardinal) on Mar 08, 2014 at 19:22 UTC |