|
Re: Getting window size (correctly): msg#00120gnome.gtk+.perl
Ok, so now I am really confused! Try this out: #! /usr/local/bin/perl use Gtk; init Gtk; $window = new Gtk::Window('toplevel'); (undef, undef, $window_width, undef) = @{$window->allocation}; $window->signal_connect('configure_event', \&resize ); $window->signal_connect('destroy', sub { Gtk->exit( 0); }); $window->show(); main Gtk; exit(0); sub resize { my ($window, $params, $event) = @_; my ($x, $y, $w, $h) = @{$window->allocation}; print "allocation : $x, $y, $w, $h\n"; my ($x, $y, $w, $h) = $window->window->get_geometry; print "get_geometry : $x, $y, $w, $h\n\n"; } If you run this it draws a window and prints out the geometry/allocation data. If you resize the window you'll see that the allocation number doesn't change, but the geometry data does. If you move the window, the allocation data catches the previous resize data to give the correct dimensions. I guess that'll be the mostly bit in action : >...allocations all (well mostly) change on a window resize... Anyone got a way round this? Cheers, Bill. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | coloring individual pixels: 00120, Daniel Carrera |
|---|---|
| Next by Date: | Re: handheld GTK+: 00120, raptor |
| Previous by Thread: | Re: Getting window size (correctly)i: 00120, eichin-gtk-perl |
| Next by Thread: | (no subject): 00120, D |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |