Sample PHP-GTK2 + Glade Application - Notepad Application

September 24th, 2008

If you’re looking for sample applications using PHP-GTK2 + Glade, here’s one more which I’ve just published on devshed.com:

Link: Building Your Own Desktop Notepad Application Using PHP-GTK

This article will show you how easy it is to build a desktop Notepad application using PHP-GTK2 + Glade.

As with many other sample codes on this site, you will have the complete sample code + glade file and detailed explanations of how everything fits together.

/kksou

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

Compiling standalone PHP-GTK2 applications on windows using PriadoBlender

July 21st, 2008

If you’ve been wondering how to compile standalone PHP-GTK2 applications on windows using PriadoBlender, I’ve just written an article explaining the details.

Important Note: For now, PriadoBlender only works with the Gnope version of PHP-GTK (which is running PHP-GTK2 alpha version with PHP v5.1.4 and GTK+ v2.6.9). I’m sure the author of PriadoBlender will upgrade the program soon to work with PHP-GTK v2.0.

/kksou

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

Setting the background color of GtkButton

July 16th, 2008

I’ve written a sample code that shows how to set the background color of a GtkButton.

Sample Code 23: How to set the background color of GtkButton?

Some of you have written to me that the code does not work on your machine. The fix is as follows:

  1. Assuming you’re using the latest php-gtk v2.0.1
  2. Go to [php-gtk root folder]/etc/gtk-2.0 and open the file gtkrc in your favorite editor.
  3. Comment out lines 45, 46 and 47 as follows:
  4. #engine "wimp"
    
    #{
    
    #}
  5. Save and close the file.

Now try running the sample code again. Did it work this time?

/kksou

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

interactive search in GtkTreeView for PHP GTK v2.0

June 28th, 2008

If you have tried the latest PHP-GTK v2.0 or v2.0.1 on the windows platform, you will know that there seems to be some bugs with the interactive search for GtkTreeview. The interactive search works in PHP-GTK2 alpha and beta versions, but not in v2.0 or v2.0.1.

Carl shared with us a brilliant work-around he has found.

Using his method, here are a couple of complete sample codes that show how to set up interactive search in PHP-GTK v2.0 and v2.0.1.

/kksou

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

PHP-GTK v2.0.1 with GD2 library

June 28th, 2008

The latest windows binary of PHP-GTK v.2.0.1 from gtk.php.net does not come with the GD2 library.

If you need to set up the php_gd2.dll, please refer to the following article:

PHP-GTK v2.0.1 with GD2 library

/kksou

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

PHP-GTK 2.0.1 released!

May 22nd, 2008

In case you’re not aware, PHP-GTK 2.0.1 has just been released!

I will try out some of the new features and let you know.

/kksou

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

p.s. I just tried the interactive search on treeview for the new version. Seems like it’s still not fixed yet for the windows version. Something’s different though. Last time in windows, you need to hit ctrl-F to start the interactive search. Now, like the linux version, you can just start typing. However, it stops at the first character and doesn’t receive any more keyboard input.

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