Gtk2::Gdk::Screen and $widget->size_request

A couple of things:

When I run this script:

use Gtk2;
use Data::Dumper;
use strict;


my $window = Gtk2::Window->new('toplevel');
$window->signal_connect('delete_event', sub { exit });

my $button = Gtk2::Button->new('Click here');
$button->signal_connect('clicked', sub {
        my $screen = $window->get_screen;
        print $screen->get_width()."\n";





I get this error message:

GType 'GdkScreenX11' is not registered with GPerl; representing this
object as first known parent type 'GdkScreen' instead at line 13.
Can't locate object method "get_width" via package "Gtk2::Gdk::Screen"
at line 14.

Secondly, the GTK docs suggest that I can call size_request() on a
realized widget to get the on-screen dimensions, but I get a "can't
locate object method" error.

Are these parts of the API that haven't been implemented yet? Or am I
doing something wrong?

I don't know the first thing about XS and have never written a line of
C, so I'd appreciate some insights.

Finally, there used to be a gtk-perl channel on Maybe it
could be resurrected? I'm sure there are lots of people who have silly
little questions like those above who don't want to post to a mailing
list to have answered.


Gavin Brown
e: gavin brown uk com
PGP/GPG key ID: 891D8FCA

Attachment: signature.asc
Description: This is a digitally signed message part

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