Re: Getting screen position



Steve Fox <drfickle k-lug org> said:


[...]

Could you look at my test program and tell me where I'm being stupid
please?

I greatly appreciate your assistance. Thanks.


I didn't tested it but here is the typo I think. be carefull to verify that
when the destroy signal is called, the $window still exists. iirc the destrioy
signal is called just before really destriying it, but not 100% sure.

Anyway you forgot the ->window .

---------------------------------------------------------------------

#!/usr/bin/perl -w

use Gtk;

Gtk->init;

my $window = new Gtk::Window;
$window->signal_connect("destroy", sub { buhbye($window); });
$window->show_all;

Gtk->main;

exit;

sub buhbye {
      my $window = shift;

      print $window->get_name()."\n";

      my ($x, $y) = $window->get_position;

my ($x, $y) = $window->window->get_position;


      print "x: $x, y: $y\n";

      Gtk::main_quit("Gtk");
}


-- 
dams



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