PHP-GTK Explorer
by kksou


Your "secret weapon"
for learning, exploring,
understanding and mastering
PHP-GTK2





From: kksou


Date: September 5, 2008


Dear PHP-GTK Friends,


What is kksou PHP-GTK Explorer?

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, as highlighted below.


Viewing the Object Hierarchy

One of the most important thing in mastering php-gtk2 is to understand the object hierarchy of a widget, i.e. who are its ancestors, its siblings and its children. The "kksou PHP-GTK Explorer" have three different tabs to show you these three views.

 

View 1: The Object Hierarchy For GtkToggleButton

View 1: The Object Hierarchy For GtkToggleButton

 

View 2: GtkToggleButton and its siblings

View 2: GtkToggleButton and its siblings

 

View 3: GtkToggleButton and its children

View 3: GtkToggleButton and its children

 

View 4: The Entire PHP-GTK2 Classes Object Hierarchy

For those who are adventurous, there is also one tab where you can see the entire object hierarchy of all the PHP-GTK2 classes (340+ for the Gnope version, and 400+ for the beta release).

View 4: The Entire PHP-GTK2 Classes Object Hierarchy

 

Search for widget: Auto-completion

The Search for Widget field supports auto-completion. Just start typing, e.g. "gtkb", you will be presented with a list of widgets that match "gtkb" as shown below:

Auto Completion for search field

 

Search for methods / signals

new in v1.03

Suppose you want to look up the man page for the method pack_start(), you must first know which widget it belongs to. Now with PHP-GTK2 Explorer v1.03, you can simply type in pack_start in the search field, and you will be displayed with all widgets with the method pack_start() as shown below:

Search for Method

 

Browse History

new in v1.03

Now with PHP-GTK2 Explorer v1.03, just press the F8, and you will be able to browse all the widgets that you have explorerd. Click on the history item, and you will be taken directly back to that widget as shown below:

Browse History

 

Other Features

Below are the highlights of other major features of the "PHP-GTK Explorer":

  • A tab that lists only the methods specific to the selected widget.
  • A tab that lists ALL the methods, including all the inherited methods from its ancestors, of the selected widget.
  • Highlight a method and press Ctrl-C to copy the method to the clipboard. You can then paste the method to your favorite editor.
  • Press the middle mouse button on any widget (on the left pane) or method/signal (on the right pane). The corresponding official PHP-GTK2 man page will be displayed in the browser.
  • Press the right mouse button to popup a context-sensitive menu.
  • Press F3 to go back to the previous widget you have explored, and F4 to move foward.
  • Press Ctrl-L to set the language of the official PHP-GTK2 man page (currently provided in gtk.php.net: English, Brazilian, Bulgarian, Simplified Chinese and Japanese)
  • For linux users, press Ctrl-B to set the path to your browser.

Is this Free?

Yes, just like many of the sample codes in this web site, the program is free for personal use!


So, go ahead and download a copy (from the download area). Whether you're starting on php-gtk2 or a seasoned php-gtk2 programmer, I think you'll find this tool useful.


Enjoy, and have lots of fun with php-gtk!


Warm Regards,

/kksou

p.s.

  • For linux users, if you wish to "hardcode" the browser path in the program, please drop me a note via the feedback form.
  • If you wish to "hardcode" the language setting, please also drop me a note via the feedback form.

User Comments (11)

  1. Sai Says:
    June 16, 2008 4:33am

    This tool is useful in creating GUI's.

  2. Marcel from Germany Says:
    October 19, 2007 6:39am

    nice one

  3. Wonsang, Kwon from Korea Says:
    September 09, 2007 9:47pm

    Thanks for your usefule tools

  4. Kksou Says:
    August 17, 2007 12:36am

    Hi Fernando, thanks for informing me about the change from Gtk::TYPE_STRING to GObject::TYPE_STRING. Have added in your suggested fix. Please let me know if the updated application (v1.02) is working with your cvs version. Thanks! /kksou

  5. Fernando Correa Da Conceição from Brazil Says:
    August 15, 2007 9:26pm

    Hi! You need add a fix in it. There is a recent change on cvs and some constants named Gtk:: changed to GObject. Take this as an example: if (defined("GObject::TYPE_STRING")) { $this->model = new GtkTreeStore(GdkPixbuf::gtype, GObject::TYPE_STRING, GObject::TYPE_STRING); } if (defined("Gtk::TYPE_STRING")) { $this->model = new GtkTreeStore(GdkPixbuf::gtype, Gtk::TYPE_STRING, Gtk::TYPE_STRING); } Is dirty, but works. As it is now it do not work for linux, who uses the php-gtk from cvs like me, and when there is a new build on windows, it will not work too. Thanks! ps: This is a very usefull tool!!!

  6. Kksou Says:
    July 25, 2007 8:55am

    Hi Bernard, Have fixed the bug for GtkMenuBar. Thanks. As for GtkFileChooser, as the program uses reflection class to get the classes and corresponding methods, if GtkFileChooser doesn't show, it means it's not in your version of php-gtk2. You might want to download the source code and recompile it again. The widget has long been there, even in alpha version. Regards, /kksou

  7. Bernard Fouché Says:
    July 25, 2007 3:29am

    Hi. Found two problems: 1) When looking for GtkMenuBar, the program fails: PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class GtkPackDirection does not exist' in /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php:192 Stack trace: #0 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(192): ReflectionParameter->getClass() #1 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(197): F43520679('GtkMenuBar') #2 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(199): F47932cc8('GtkMenuBar') #3 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(78): F951b6d3f('GtkMenuBar') #4 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(24): F05ce9142->F3ac34083() #5 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(175): F294a07d3->F8148b659('GtkMenuBar') #6 [internal function]: F3f8e5889->Fbc8920c3(Object(GtkMenu), Object(GdkEvent)) #7 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(6): Gtk::main() #8 /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php(45): F294a07d3->__construct() #9 {main} thrown in /home/bernard/Desktop/kksou_phpgtk_explorer_v1.01.php on line 192 2) I can't find GtkFileChooser widget. I use PHP 5.2.2 with PHP-GTK module 2.0.0beta on Linux F7. Regards, Bernard

  8. Kksou Says:
    July 24, 2007 11:03pm

    Hi Martti Pitkanen from Finland and No Inporting from cn, I've found where the bug is. Have fixed it. Please download it again. It should work now. Thanks for pointing out the error. Regards, /kksou

  9. No Inporting from cn Says:
    July 24, 2007 9:53pm

    Fatal error: Cannot re-assign $this in E:\studio\kksou\kksou_phpgtk_explorer_v1[ 1].01.phpw on line 109

  10. Martti Pitkanen from finland Says:
    July 23, 2007 4:27pm

    Hi, I got this error msg: C:\apps60\aplcomp\apps>php.exe kksou_phpgtk_explorer_v1.php Fatal error: Cannot re-assign $this in C:\apps60\aplcomp\apps\kksou_phpgtk_explo rer_v1.php on line 100

  11. Lg from Bulgaria Says:
    July 23, 2007 4:06am

    Perfect!

Leave a Comment

Is this tool useful?

Please enter your feedback and comments below.

p.s. For bugs, would greatly appreciate if you could post it in the forum area so that it's easier for me to respond, follow-up and post fixes.

Name:
Country: (optional)
Your Comments:
ANTI-SPAM key: