PHP-GTK Tools
|
User rating: 4.0 (from 5 users) Monday, 03 March 2008 Your "secret weapon" for learning, exploring, understanding and mastering PHP-GTK2
The "kksou PHP-GTK Explorer" is a unique tool for learning, exploring, understanding and mastering the PHP-GTK2 classes and methods.
It's like the Dev_Inspector (from gnope.org), but with a lot more functionalities added.
Now works with the new PHP-GTK v2.0 release! |
|
PHP-GTK References
|
Wednesday, 16 April 2008 This article shows you the ESC/POS commands for the printing of barcodes on standard Epson receipt printer such as the Epson TM-T88III.
The ESC/POS commands are a set of proprietary POS printer command system developed by EPSON.
If you have a different printer, please refer to the corresponding codes in your printer manual. But Epson is pretty much the industry standard for receipt printer and most receipt printers support these ESC/POS commands. You can just try the commands below. Most likely it will work on your receipt printer. |
|
|
Thursday, 13 March 2008 In case you're not aware, there are many widgets that you can set text or text labels with markup language, e.g. GtkLabel, GtkTreeView.
Below is a quick reference of the Pango Markup Language: |
|
|
Wednesday, 05 March 2008 I have migrated a considerable amount of codes to the new PHP-GTK v2.0 release. Here are some tips and tricks I've found along the way... |
|
Welcome!
This site is a collection of problems, solutions, and practical examples for PHP-GTK2 programmers. Each example contains a complete sample code followed by explanation.
Important Note
I'm in the process of upgrading this site to a completely new framework. The migration involves a lot more work than I thought. So please bear with me as I try to migrate the rest of the stuff over...
Installation
Ready to dive into php-gtk2 and start developing your own php desktop applications?
- Linux: here's a step-by-step instruction on how to compile php-gtk2 on linux.
- Windows: Setting up the latest beta release of PHP-GTK2 on windows is now as easy as 1-2-3. Just download - unzip - and off you go! Details here.
- Glade3 for Windows: Details here.
Tutorial
PHP-GTK2 Demystified - now online!
Latest Blog Articles
|
Tuesday, 06 May 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! |
|
|
|
|
Monday, 14 April 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 |
|
|
Wednesday, 26 March 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. |
|
|
Tuesday, 11 March 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! |
|
|
Latest Sample Codes
|
This is in response to Giovanni's post titled "a button with an image in it in a Treeview".
In Part 1, I've showed a solution using GtkListStore.
In Part 2, we used a tree store instead of list store.
In this Part 3, we add a realtime total time elapsed to the project (which is the total sum of time elapsed for each individual activity) as shown below.
We also add the following enhancements:
- There was a lag of 1 second after you click the start button. This has been fixed.
- Fixed the bug in which the timers starts when you click on the button_blank32.gif that goes with a project.
- Wrote a format_time() function so that it can now displays time greater than 24 hrs

|
|
User rating: 5.0 (from 1 user)This is in response to Giovanni's post titled "a button with an image in it in a Treeview".
In Part 1, I've showed a solution using GtkListStore.
In this Part 2, I present the same solution, but using GtkTreeStore instead of GtkListStore so that the projects and activities can be shown in a treeview manner as shown below.
Note that I've also changed the millisecond timer to a seconds timer because it seems that having more than 6 concurrent millisecond timer running in a treeview seems to be a bit too taxing for the treeview. You can try it for yourself. The timer doesn't get updated often enough, even though we set the timeout at 1ms interval.

|
|
|
This is in response to Giovanni's post titled "a button with an image in it in a Treeview".
He would like to have a button (with an image in it) in a GtkTreeView as shown below.
When the user clicks on the start button of an activity, the start button will change to a stop button, and the corresponding timer of the activity will start running.
When the user clicks on the stop button, the timer will stop, and the button will change back to "Start". The user may click the Start button again to continue the timer.

|
|
|
You would like to grab a screenshot of your application and save it in a .png file as shown below:

|
|
|
Suppose you have two monitors.
You would like your PHP-GTK application to always open on the second monitor as shown below:

|
|
|
You have set up a GtkNotebook with multiple tabs.
Suppose you would like to allow the users to hide and unhide tabs as shown below:

|
|
|
You have set up two GtkNotebooks.
This example shows you how you can move a tab (together with its contents) from one notebook to another using drag and drop as shown below:
Before:

After:

|
|
User rating: 5.0 (from 1 user)This is in response to Paul's post titled "Access Treeview cell renderers".
He would like to highlight some rows and cells based on some conditions.
In this example, if there is some error, the respective rows will be highlighted in red. The filename of the respective row will also be bold as shown below. This example also illustrates one commonly used technique: the serial number appearing on the left-most column will always stay in running sequence - even when the user deleted some rows.

|
|
|
The new GtkTooltip is so flexible that you can even display a GtkTable in a tooltip as shown below:
Key method used: GtkTooltip::set_custom().

|
|
|
In Part 4, I've showed you how to display an image as well as a markup text in a tooltip.
However, instead of display the label to the right of the image, you would like the image to be displayed below the image as shown below:
Key method used: GtkTooltip::set_custom().

|
|
|