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


In reply to Can't call method "get_screen" on an undefined value by hakim-djz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.