Created
August 19, 2012 00:21
-
-
Save bobmagicii/3390511 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BobWindow extends GtkWindow { | |
public function __construct() { | |
parent::__construct(); | |
$this->set_size_request(256,256); | |
$this->set_title('BobWindow'); | |
$this->set_position(Gtk::WIN_POS_CENTER); | |
$this->connect_simple('delete-event',function(){ | |
Gtk::main_quit(); | |
return; | |
}); | |
$this->connect_simple('configure-event',function(){ | |
// this is where the problem is. | |
while(Gtk::events_pending() || Gdk::events_pending()) | |
Gtk::main_iteration(); | |
// with this. | |
list($w,$h) = $this->get_size(); | |
list($x,$y) = $this->get_position(); | |
echo "{$w}x{$h} @ {$x},{$y}", PHP_EOL; | |
return; | |
}); | |
$this->show_all(); | |
return; | |
} | |
} | |
$w = new BobWindow; | |
Gtk::main(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment