Joomla! Articles

May 6th, 2008

In case you’re interested, this site is developed using Joomla!, one of the most popular PHP Open Source Content Management Systems.

I’ve released quite a number of plugins for Joomla!:

I’ve also written quite a number of articles on Jooma! (for both v1.0 and v1.5):

Joomla 1.0:

Joomla 1.5:

The main Joomla! table of contents is here: http://www.kksou.com/php-gtk2/joomla/

Enjoy!

/kksou

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

Barcode printing on receipt printer

April 16th, 2008

A receipt printer can not only print receipts. It can print barcodes too!

The following article shows you how to print barcode labels with your receipt printer.

Sample Code 479: How to print barcode label - Part 1 - EAN13 barcodes

You can also find a list of ESC/POS Commands here:
Quick Reference: ESC/POS Commands

/kksou

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

Drag-and-drop complex data structures

April 14th, 2008

If you’re using drag-and-drop and need to include complex data (or multibyte characters) in your drag data, you’ll find that sometimes using PHP’s serialize() doesn’t work. Here’s a solution:

Non-OOP version:
Sample Code 475: How to drag and drop between 2 GtkTreeViews - Part 7 - another method of passing along complex drag info

OOP version:
Sample Code 476: How to drag and drop between 2 GtkTreeViews - Part 8 - another method of passing along complex drag info - OOP ver 1

Sample Code 477: How to drag and drop between 2 GtkTreeViews - Part 9 - another method of passing along complex drag info - OOP ver 2

/kksou

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

Running GtkHTML scripts without using gconfd-2.exe | php script.php

April 14th, 2008

If you’re using GtkHTML in your PHP-GTK app, learn this wonderful trick shared by Mario Staas that allows you to run these scripts just like a normal php-gtk script without the need to type gconfd-2.exe | php script.php in the command window.

Sample Code 474: How to display html text using gtkhtml - Part 2

/kksou

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

GtkTooltip for GtkTreeView

March 26th, 2008

I finally have some time to sit down and explore the new PHP-GTK v2.0 release.

The first one I tried was displaying tooltip for treeview with the use of the new widget GtkTooltip. It was a lot of trials and errors, because there was not much documentation. I could get the whole row, or whole column to display the same tooltip. But how do you get each individual cell to display different tooltips?

This article Sample Code 461: How to display tooltips in GtkTreeView - Part 4 is the first of a series of articles to share with you some of the new widgets and methods of the new PHP-GTK v2.0 release.

If you’re still wondering whether to switch over to the new version, try out some of these sample codes. I think you’ll never look back again.

/kksou

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

ebook “PHP-GTK2 Demystified” - now available online!

March 11th, 2008

It’s not Christmas.

But yes, I’ve decided to make my ebook “PHP-GTK2 Demystified” freely available online.

If you’ve not heard about this book, here’s the details.

And here’s the link to the book: PHP-GTK2 Demystified - Master the three Key Concepts of PHP-GTK2

Happy reading!

/kksou

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

all 400+ sample codes now PHP-GTK v2.0 compatible!

March 5th, 2008

Took me two whole nights to convert all the 400+ sample codes on this website so that all of them can now be run with the latest PHP-GTK v2.0 release!

This means that you have now 400+ ready-to-run examples for the PHP-GTK v2.0 release - with coverage of more than 95% of all the available GTK widgets.

Of course, all these examples are still backward-compatible with the alpha and beta release of PHP-GTK2, in case you decide to stay with the previous release.

I’ve only tested the sample codes on the windows platform using the latest windows binary. If you have different results on the linux or mac platform, please let me know, ok?

/kksou

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

PHP-GTK Explorer v1.05

March 4th, 2008

I’ve just released PHP-GTK Explorer v1.05.

This version now works with the latest PHP-GTK v2.0 release, so that you can now explore all the new widgets (e.g. GtkBuilder) and new methods (e.g. GtkTreeView now supports tooltip!)

Download a copy now!

/kksou

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

PHP-GTK v2.0 - adding gd2

March 4th, 2008

The default windows binary available from the official site does not include the gd2 library.

In case you need this library, you can get the libraries from Elizabeth Smith’s blog. (Note: she’s the one who compiled the windows binary in the official php-gtk site).

1. Goto http://perisama.net/downloads, navigate to “MSVC6″, then “PHP-5.2.5″, “Release”, and “ext”. You will see the file php_gd2.dll there.

2. Download the file and place it in the “ext” folder where you installed the php-gtk2.

3. In the php.ini file, add one more line

extension=php_gd2.dll

4. Now you have gd2 with php-gtk2!

For a quick test, you could try the following sample code:
Sample Code 232: How to draw a simple bar graph using GD2

/kksou

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

p.s. Thanks to Elizabeth Smith for sharing the above tips.

PHP-GTK v2.0 - adding GtkHtml and GtkExtra

March 3rd, 2008

The default windows binary available from the official site comes packaged with php_gtk_libglade2.dll and php_gtk_sourceview2.dll. GtkHtml and GtkExtra are not included yet.

In case you need these two libraries, you can get the libraries from Elizabeth Smith’s blog. (Note: she’s the one who compiled the windows binary in the official php-gtk site).

1) Download the following file from http://perisama.net/downloads/GTK/:
php5.3-php-gkt2cvs.zip

2) Unzip the file

3) In the folder “ext”, you will see the 2 libraries: php_gtk_html2.dll and php_gtk_extra2.dll. Copy them to the corresponding folder where you installed the php-gtk v2.0.

4) Edit your php.ini and add these two libraries:
php-gtk.extensions = php_gtk_libglade2.dll,php_gtk_sourceview2.dll, php_gtk_extra2.dll, php_gtk_html2.dll

That’s it! You now have PHP-GTK v2.0 with GtkHtml and GtkExtra!

/kksou

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