<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>westworld: a webmasters best friend &#187; PHP-GTK</title>
	<atom:link href="http://www.westworld.be/category/php-gtk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.westworld.be</link>
	<description>A webmasters best friend</description>
	<lastBuildDate>Mon, 14 Jun 2010 18:12:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP-GTK: making an &#8220;About&#8221; dialog</title>
		<link>http://www.westworld.be/php-gtk/php-gtk-making-an-about-dialog/</link>
		<comments>http://www.westworld.be/php-gtk/php-gtk-making-an-about-dialog/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 14:53:47 +0000</pubDate>
		<dc:creator>westworld</dc:creator>
				<category><![CDATA[PHP-GTK]]></category>

		<guid isPermaLink="false">http://www.westworld.be/?p=185</guid>
		<description><![CDATA[Below is an example of how you can code an About dialog in PHP-GTK.
The mail_hook and url_hook are callback functions to open your default email client and webbrowser.
These functions have been tested under Windows XP. I don&#8217;t know if they work on Mac or Linux.
	static public function About(){

		$dlg = new GtkAboutDialog();
		$dlg->set_program_name('Myapp');
		$dlg->set_version('0.0.1');
		$authors = array ('John Doh');
		$dlg->set_authors($authors);
		$documenters [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Below is an example of how you can code an About dialog in PHP-GTK.<br />
The mail_hook and url_hook are callback functions to open your default email client and webbrowser.<br />
These functions have been tested under Windows XP. I don&#8217;t know if they work on Mac or Linux.</p>
<textarea cols="40" rows="10" name="code" class="Php">	static public function About(){

		$dlg = new GtkAboutDialog();
		$dlg->set_program_name('Myapp');
		$dlg->set_version('0.0.1');
		$authors = array ('John Doh<john@doh.com>');
		$dlg->set_authors($authors);
		$documenters = array('John Doh','Mr Smith');
		$dlg->set_documenters($documenters);
		$dlg->set_comments("you comments go here");
		$dlg->set_copyright('Copyright (C) 2009 myself');
		$dlg->set_license("Anyone is free\n to distribute\n and alter the code");
		$dlg->set_logo($dlg->render_icon(Gtk::STOCK_CDROM, gtk::ICON_SIZE_LARGE_TOOLBAR));
		$dlg->set_translator_credits("I like to thank my producer and my mom'");
		$dlg->set_url_hook("Mainwindow::url_hook");
		$dlg->set_website('http://www.yoursite.com');
		$dlg->set_website_label("www.yoursite.com"); 
		$dlg->set_email_hook("Mainwindow::mail_hook");
		$dlg->run();
		$dlg->hide();
	}

	static function url_hook($dialog, $url){
	$shell = new COM('WScript.Shell');
	$shell->Run('cmd /c start "" "' . $url . '"', 0, FALSE);
	unset($shell); 
	}	
	
	static function mail_hook($dialog, $mailto){
		$shell = new COM('WScript.Shell');
		$shell->Run('cmd /c start "" "mailto:' . $mailto . '"', 0, FALSE);
		unset($shell);
	}</textarea>
	<!-- Wordpress Code Snippet -->
	<script type="text/javascript" src="http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/js/shBrushPhp.js"></script>
	<link type="text/css" rel="stylesheet" href="http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End Wordpress Code Snippet -->
	

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.westworld.be/php-gtk/php-gtk-making-an-about-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP GTK: liststore error (undefined class constant)</title>
		<link>http://www.westworld.be/php-gtk/php-gtk-liststore-error-undefined-class-constant/</link>
		<comments>http://www.westworld.be/php-gtk/php-gtk-liststore-error-undefined-class-constant/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 14:42:28 +0000</pubDate>
		<dc:creator>westworld</dc:creator>
				<category><![CDATA[PHP-GTK]]></category>

		<guid isPermaLink="false">http://www.westworld.be/?p=180</guid>
		<description><![CDATA[Been experimenting with php-gtk over the last few days. When I was trying to use a liststore,  php threw a fatal error. &#8220;Undefined class constant &#8216;TYPE_STRING&#8217;&#8221;.
After testing the example from the PHP_GTK site I got the same errror. The PHP-GTK example is out of date. Starting with PHP-GTK 2.0.0 the TYPE constants were moved [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Been experimenting with php-gtk over the last few days. When I was trying to use a <strong>liststore</strong>,  php threw a fatal error. <strong>&#8220;Undefined class constant &#8216;TYPE_STRING&#8217;&#8221;</strong>.<span id="more-180"></span><br />
After testing the example from the PHP_GTK site I got the same errror. The PHP-GTK example is out of date. <em>Starting with PHP-GTK 2.0.0 the TYPE constants were moved from the Gtk::class to Gobject, so use Gobject::TYPE_STRING instead.</em><br />
Below is the correct code.</p>
<textarea cols="40" rows="10" name="code" class="Xml"><?php
/*  GtkListStore example
 Here we create a list of the largest cities.
 For that we need a list store with two columns:
 The name and the number of inhabitants.
 The "name" is of type "string", and the number
 of inhabitants is of type long (big integer).
*/
$store = new GtkListStore(Gobject::TYPE_STRING, Gobject::TYPE_LONG);
 
/*
* Using the "set" method
*/
 
//at first, get an iterator for a new row
$iterator = $store->append();
//now use that to set the name at that row (column 0)
$store->set($iterator, 0, 'Tokio');
//same row: set the inhabitants into column 1
$store->set($iterator, 1, 34100000);
 
//You can set a whole row at once:
$iterator = $store->append();
//we add the data "Mexico city" at column 0 and 
// "22 million" at column 1 at the row $iterator
$store->set($iterator, 0, 'Mexico city', 1, 22650000);
 
//Or, even faster: don't even create an iterator variable
$store->set($store->append(), 0, 'Seoul', 1, 22250000);
 
 
/*
* Using "append" to add a row without an iterator
*/
$store->append(array('New York', 21850000));
$store->append(array('São Paulo', 20200000));
 
 
/*
* And now show what we've got in the store
*/
function echoRow($store, $path, $iter)
{
    $city   = $store->get_value($iter, 0);
    $number = $store->get_value($iter, 1);
    echo $city . ' has ' . $number . " inhabitants.\r\n";
}
$store->foreach('echoRow');
?></textarea>
	<!-- Wordpress Code Snippet -->
	<script type="text/javascript" src="http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/js/shBrushXml.js"></script>
	<link type="text/css" rel="stylesheet" href="http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://www.westworld.be/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End Wordpress Code Snippet -->
	

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.westworld.be/php-gtk/php-gtk-liststore-error-undefined-class-constant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
