Archive for February, 2008

Direct loading of gd2 image into php-gtk

Thursday, February 28th, 2008

The php-gtk2 beta version now supports direct loading of gd2 image into php-gtk.

$im = imagecreate(360, 200);

$pixbuf = GdkPixbuf::new_from_gd($im);

$img = GtkImage::new_from_Pixbuf($pixbuf);

You can view a full sample code here:
How to draw a simple bar graph using GD2?

/kksou

http://www.kksou.com/php-gtk2
The place for php-gtk2 sample codes

PHP-GTK Explorer v1.04

Thursday, February 28th, 2008

Have just added “PHP-GTK Explorer” to the new site: PHP-GTK Explorer

It’s now version 1.04.

For registered members, log in, and you will see the download link on the page.

Enjoy!

/kksou

http://www.kksou.com/php-gtk2
The place for php-gtk2 sample codes

Opening an application at last window position

Wednesday, February 20th, 2008

Fragarach 87 posted a question related to opening an application in the second monitor.

After some trials and errors, I came up with a sample code that allows you to open an application at the last window position:

Sample Code 438: How to open an application at last window position - works with multiple monitors?

The above works with multiple monitors too!

/kksou

http://www.kksou.com/php-gtk2
The place for php-gtk2 sample codes

GtkAction and GtkActionGroup

Wednesday, February 20th, 2008

If you have been wondering what’s GtkAction and GtkActionGroup — what are they? what’s their use? — then take a look at some of the sample codes below:

Sample Code 432: How to setup and process a GtkButton using GtkAction - Part 1?

Sample Code 433: How to setup and process a GtkButton using GtkAction - Part 2 - add stock image?

Sample Code 434: How to activate deactivate a bunch of GtkButtons using GtkAction and GtkActionGroup?

Sample Code 435: How to hide unhide a bunch of GtkLabels using GtkAction and GtkActionGroup?

Sample Code 436: How to set up toolbar using GtkAction - Part 1?

Sample Code 437: How to set up toolbar using GtkAction - Part 2 - add accelerators?

If you’re developing serious applications using PHP-GTK2, take a look at these examples. You will soon find that this is a useful widget that has been so little documented, but extremely useful in some occasions.

I’ve only finished half of these sample codes. There are many more to come. You will see true powers of GtkAction and GtkActionGroup when it comes to managing menu items and toolbar items concurrently. It allows you to maintain consistencies across menu items and toolbar items very efficiently as you shall soon see.

/kksou

http://www.kksou.com/php-gtk2
The place for php-gtk2 sample codes