#! /usr/bin/perl BEGIN { use Glib::Object::Introspection; Glib::Object::Introspection->setup( basename => 'Gio', version => '2.0', package => 'Glib::IO'); } package MyWindow; use strict; use warnings; use utf8; binmode STDOUT, ':utf8'; use Gtk3; use Glib ('TRUE', 'FALSE'); use base 'Gtk3::ApplicationWindow'; sub new { my $window; # a buidler to add the UI designed with Glade to the grid: my $builder = Gtk3::Builder->new(); # get the file (if it is there) $builder->add_from_file('test.glade') or die 'file not found'; $window = $builder->get_object('window'); # fullscreen action my $fullscreen_action = Glib::IO::SimpleAction->new('fullscreen',undef); $fullscreen_action->signal_connect('activate'=>\&fb_cb); $window->add_action($fullscreen_action); return $window; } sub fb_cb { print "YEAH\n"; } package main; use strict; use warnings; use utf8; binmode STDOUT, ':utf8'; use Gtk3; use Glib ('TRUE', 'FALSE'); my $app = Gtk3::Application->new('app.test', 'flags-none'); $app->signal_connect('activate' => \&_build_ui ); $app->run(\@ARGV); exit; sub _build_ui { my ($app) = @_; my $window = MyWindow->new(); $app->add_window($window); $window->show_all(); }