SWT: after creating Shell isDisposed is true [message #824299] |
Mon, 19 March 2012 10:02 |
Eclipse User |
|
|
|
hi everybody!
Ive been testing php java bridge with great succes, the problem is that when i try to create a shell object from php, it has isDisposed to true. In fact i can notice how the window is created for a couple of seconds and then disappears.
Ive tried the same code in java and works ok. The bridge framework is working good because Ive done tests with QTjambi and everything its ok..
Can someone give me some light on this?
My enviroment is Windows XP and the code im trying to test in php is( the same thing in java works ok):
class HelloWorld {
function run() {
$display = new Java ("org.eclipse.swt.widgets.Display");
echo "\$display:".$display.PHP_NL;
$shell = new Java ("org.eclipse.swt.widgets.Shell", $display);
echo "\$shell:".$shell.PHP_NL;
echo "\$display:".$display.PHP_NL;
echo "!\$shell->isDisposed(): ".((bool)(!$shell->isDisposed())).PHP_NL; //false
echo "\$shell->isDisposed(): ".((bool)($shell->isDisposed())).PHP_NL; //true
$shell->open();
echo "Despues de open..".PHP_NL;
echo "\$shell:".$shell.PHP_NL;
echo "\$display:".$display.PHP_NL;
echo "!\$shell->isDisposed(): ".((bool)(!$shell->isDisposed())).PHP_NL;
echo "\$shell->isDisposed(): ".((bool)($shell->isDisposed())).PHP_NL;
while (!$shell->isDisposed()) {
if (!$display->readAndDispatch()) {
$display->sleep();
}
}
$display->dispose();
}
}
const PHP_NL = PHP_EOL;
|
|
|
Powered by
FUDForum. Page generated in 0.03682 seconds