When I first started using PHP-GTK2, I find the most confusing (and at that time frustrating) part in learning PHP-GTK2 is the layout of widgets.
In HTML, I can easily use tables, or CSS, to position and align any text, graphics or input elements I want.
Of course, once you have learned how to use hbox’s, vbox’s and the expand parameters, this will become an easy task. (Note: even if you intend to use Glade, you still need to understand these concepts.)
I believe those who have used PHP-GTK2 would fully agree with me that this is such a powerful tool that should deserve much more attention.
And I always think the one big factor that deters people, especially those from the PHP web programming world, is this laying out of widgets.
That’s why when I started playing with GtkHTML, I thought “wow! this could be it!”
This widget literally allows you to layout and align widgets using the good old HTML you’re so familiar with!
I’ve come out with three examples to illustrate this:
How to align GtkEntry fields - Part 3 - using gtkhtml?
How to layout widgets using gtkhtml - Example 2?
How to layout widgets using gtkhtml - Example 3?
As pointed out in the example, I’m still trying to figure out how to retrieve the object ID in the signal handler. In the meantime, I did a workaround so that you can see how things work.
If the PHP-GTK2 development team could put the above missing link in place (i.e. retrieving the object ID from the signal handler), I truly believe we will see a huge wave of PHP web programmers embracing PHP-GTK2.
The concept is similar to Glade. But instead of using Glade, we can actually use web tools such as Dreamweaver to design the layout, output in HTML, and load into GtkHTML. This will be so much more intuitive and easier for PHP web programmers.
Don’t you think so?
The place for php-gtk2 sample codes