XUL Motor Prototype in PHP for GTK
Gerald Bauer <[email protected]>
| Newsgroups | gmane.comp.lang.xul.announce |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Harry Fuecks - builder of the world's first XUL
motor for PHP-GTK - wrote an article about his
endavour entitled "XUL to PHP-GTK".
Harry's prototype can take in XUL like this:
<window
title="XUL to PHP-GTK"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Note full path to script for inclusion -->
<script type="application/x-php"
src="c:htdocsxul2gtkfunctions.php" />
<vbox>
<!-- Note id's must be valid PHP variable
names! -->
<textbox
id="messageBox"
value="Messages..."
readonly="false"/>
<hbox>
<button
label="Hello World!"
oncommand="hello" />
<button
label="Goodbye World!"
oncommand="goodbye" />
</hbox>
</vbox>
</window>
and turn it into a live PHP app using the GTK UI
toolkit without calling in any browser machinery.
What's more you can even script your apps using - hold
your breath - PHP. Here's an example:
<?php
function hello() {
// Use the getElementById() function to fetch the
widget
$messageBox=& getElementById('messageBox');
$length=$messageBox->get_length();
$messageBox->freeze();
$messageBox->insert_text("Hello World!n",$length);
$messageBox->thaw();
}
function goodbye() {
$messageBox=& getElementById('messageBox');
$length=$messageBox->get_length();
$messageBox->freeze();
$messageBox->insert_text("Goodbye
World!n",$length);
$messageBox->thaw();
}
?>
Harry wraps up his article writing why Glade's XML
UI haystack falls short and why XUL is long overdue.
Full story at
http://www.phppatterns.com/index.php/article/articleview/48/1/2/
- Gerald
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge