stopping a window resize



Hi,
I know I can do this by intercepting a Configure event,
and preventing it from propagating, but I was wondering
why 
$window->set_resizable(0);
dosn't work from a sub after a resize.

If you resize the window below, say enlarge it, then
hit start, the window reverts to it's original size.

#!/usr/bin/perl
use warnings;
use strict;
use Gtk2 -init;

my $window = new Gtk2::Window ();
$window->signal_connect ("delete_event", sub { Gtk2->main_quit; });
$window->set_border_width (10);
#$window->set_size_request(640,480);
#$window->set_default_size(640,480);
$window->set_position('center');

my $button1 = Gtk2::Button->new('Start');
$window->add( $button1);
$button1->signal_connect( clicked => \&start);

$window->show_all;

Gtk2->main;
#######################################################
sub start{
 
my ($xscr, $yscr) = (Gtk2::Gdk->screen_width, Gtk2::Gdk->screen_height);
print "$xscr $yscr\n";

#get current window size and freeze it
my ($x0, $y0, $width0, $height0, $depth) = $window->window->get_geometry;
print "geometry x0->$x0, y0->$y0, width->$width0, height->$height0, depth->$depth\n";
#$window->set_default_size($width0,$height0);
#$window->resize($width0,$height0);
Gtk2->main_iteration while Gtk2->events_pending;
$window->set_resizable(0);

}
__END__

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html



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