Archive for the 'PHP-GTK' Category

PHP-GTK News #18

Wednesday, June 21st, 2006

This week’s PHP-GTK News is again full of development patches as the push toward an alpha release continues. In addition, there is the announcement of an upcoming PHP-GTK 2 talk and a new 2D graphics package written in PHP-GTK 2.

Here’s the news in brief:

  • Gtk::timeout_add() memory leak fixed
  • TreeModel delete row crash will not be fixed
  • A slew of patches
  • A couple of documentation updates
  • A PHP-GTK 2 talk is scheduled for php|works
  • A 2D graphics package for PHP-GTK 2 is now available

Read on for details of the PHP-GTK news for June 14th through the 21st.

Development

GtkTreeModel Delete Row Crash:
The previously reported crash that occurs when trying to delete GtkTreeModel rows while in a foreach() callback, will not be fixed. This is because it is a known issue with Gtk+. During the callbacks called by some methods, such as foreach(), you may not delete rows of a model. Doing so causes a double free memory corruption.
To get around this, you can create an array of iters for the rows that are to be deleted during the foreach call and then delete them later.

Memory Leak Fixed:
The previously reported memory leak (bug #37787) which occured when Gtk::timeout_add() was used within a class, has been fixed. It is now safe to use Gtk::timeout_add() anywhere.

More Patches:
This weeks patches have pushed the development coverage up to 88%!
GtkColorSelection::get_color()
GtkColorSelection::set_color()
GtkEntryCompletion::get_text_column()
GtkEntryCompletion::set_match_func()
GtkFileFilter::list_filters()
GtkFileFilter::list_shortcut_folders()
GtkFileFilter::list_shortcut_folder_uris()
GtkSourceView::get_mime_types()
GtkSourceView::get_tags()
GtkTextTagTable::foreach()
GtkTreeSelection::selected_foreach()
GtkTreeSelection::set_select_function()
GtkTreeView::set_search_equal_func()
GtkTreeView::set_column_drag_function()

Documentation

Documentation Updates: (coverage)
GtkEntryCompletion (Pablo)
GtkMessageDialog (Scott)

General

PHP|Works:
Andrei has been selected to give a talk at PHP|Works in Toronto this September. His talk, simply titled “PHP-GTK 2″ will take place on the last day of the conference. Anyone interested in learning about PHP-GTK 2 from the creator himself, should definitely try to attend.

IRC

GxLib 2D Graphics Package:
Marc Quinton from the PHP-GTK IRC channel (#php-gtk on freenode) has created a 2d graphics package, called GxLib, for PHP-GTK 2. The package allows for transformations of lines and simple shapes. It is a very interesting example of what can be done with PHP-GTK 2.

PHP-GTK News #17

Friday, June 16th, 2006

Sorry for the delay. The news this week is short but rich. We only have a list of patches and documenation updates but the list for both is pretty long.

Development

Patches Galore:
Christian has been working hard to implement as many features as possible. In the last week, he has contributed the following patches:

Documentation

Documentation Updates:

PHP-GTK News #16

Wednesday, June 7th, 2006

June has started, and with that comes some finishing touches for the alpha release of PHP-GTK 2.

  • A few class implementations were completed
  • PHP-GTK 2 was made PHP 5.2 ready
  • A fix for the Win32 crash has been identified
  • More documentation updates
  • And more online resources for PHP-GTK users

Read on for more details about the PHP-GTK news from the first week of June 2006.

Development

Implementing last missing GtkNotebook method: query_tab_label_packing():
Christian has implemented the last missing GtkNotebook method, query_tab_label_packing(). The implementation of GtkNotebook should now be complete. GtkNotebook is a container that organizes its children in to pages, only one of which can be shown at a time. It provides an interface similar to the tabbed design common on many websites. GtkNotebook::query_tab_label_packing() returns an array of information about the way the labels in the tabs are treated when they are packed.

Adding last missing GtkBox method: query_child_packing():
Christian also added the final piece to GtkBox, query_child_packing(). GtkBox is an abstract base class for other box classes. GtkBox::query_child_packing() returns the default attributes used to pack children into the box.

Lots of reviews by Andrei:
Having returned from Russia, Andrei set to the task of reviewing the many patches that were submitted in the last few weeks. He made some suggestions, asked some questions and approved others. Once the remaining patches are updated, they should be all set to be committed.

PHP_5_2 Patch Committed:
This week Andrei reviewed and committed Steph’s PHP_5_2 patch. PHP-GTK 2 should now be able to make a smooth transition when PHP 5.2.x is released.

Win32 issues resolved:
After many weeks of hard work and determination, Steph was finally able to track down the Win32 crash with the help of some of the PHP Interanals folks. The issue hasn’t been fixed quite yet, but after a hopefully brief debate, a patch will be applied that will make it safe to use PHP-GTK 2 with version of PHP greater than 5.1.3.

Documentation

Documentation updates this week:

Documentation coverage analysis:
Christian has created a script that provides a report on the documentation coverage. It lists the total number of methods, signals, and properties for each class as well as the number of each that have been documented. At the moment, the coverage table says that the docs are 30% complete. The script has not yet been added to the PHP-GTK site, but it will be. For now it can be seen on php-gtk2.de.

General

Ron Tarrant’s Blog Is Back:
Ron Tarrant is back from his blogging leave of absence. He has posted several new articles on programming with PHP-GTK 2. His latest entries cover working with GtkTreeView.

PHP|A A/R/T:
A new article on PHP-GTK 2 has been posted in PHP|Architect’s A/R/T section. The latest article, “Hello PHP-GTK 2” is a detailed walk-through of the process to build a PHP-GTK 2 application. The application being built throughout the article is far from complex (a total of six lines), but it does cover all the key points for building a PHP-GTK 2 app.

Installing on OS/X:
Ben Smith has posted his experiences with trying to install PHP-GTK 1 on Mac OS/X. He offers a script to help automate the process for other users as well as a binary for others to download and use. Read more at: http://chico.benjamindsmith.com/phpgtk_osx

PHP|A: “Hello PHP-GTK 2″

Monday, June 5th, 2006

The next installment in the PHP|Architect A/R/T series on PHP-GTK is now available. The latest article, “Hello PHP-GTK 2” is a detailed walk-through of the process to build a PHP-GTK 2 application. The application being built throughout the article is far from complex (a total of six lines), but it does cover all the key points for building a PHP-GTK 2 app. I have tried to go beyond a few pages of “type this to get that” and instead show why a particular line is needed and what it really does. This article won’t give you the tools needed to create a nifty spreadsheet application but it will lay the foundations for up coming articles.

PHP-GTK News #15

Wednesday, May 31st, 2006

Summer may have had its unofficial start this week but that doesn’t mean the PHP-GTK team is taking a vacation. This week we have several development advances in some pretty important areas:

  • The cause of a critical Win32 bug has been found.
  • PHP-GTK 2 has been preped for PHP 5.2.
  • More filling out of the docs
  • And PHP-GTK 2 gets some respect

Development

GdkPixbuf::fill() Patch:
Christian supplied yet another patch this week. His latest makes GdkPixbuf::fill() accept both pixel specification and rgba values. This means that you can fill a pixbuf with a single color (black in this example) using either:

$pb->fill(0×00000000);
// or
$pb->fill(0, 0, 0, 0); // The last 0 is the alpha channel

GdkPixbuf::new_from_gd transfers red colors only Bug:
Christian filed a bug this week that points out an issue when trying to create a from a GD image. The title of the bug says that only red values are transfered. GdkPixbuf::new_from_gd() is the method used to new images created at runtime. An image such as a graph might be created from user data and then shown in the application after being converted to a GdkPixbuf. Until this bug is fixed, it will be difficult to create images on the fly.

PHP 5.2 Compat Patch:
Steph supplied a patch this week that addresses issues when PHP-GTK 2 is built against PHP 5.2. An explanation of what the patch does is well beyond me at this point. Anyway, once it is commited, it should be safe to build against PHP 5.2 (sort or, see the next item).

Ides Of March:
Steph has been hard at work trying to track down the cause of the “Win32 Crash”. The crash occurs when an application shutsdown if PHP-GTK 2 was built against PHP 5.1.4 or later (maybe 5.1.3 also but it isn’t confirmed). After many days of hard work, Steph finally cracked the problem. It is related to bug #36568 which was fixed by including the Win32 config file in the Zend config file. Apparently this throws off TSRM. The TSRM config tries to redefine something that was already defined in the Zend config. At this point, Steph is waiting for Dmitry Stogov to re-fix the bug. When that is cleared up the PHP-GTK 2 Win32 crash should disappear.

GtkSourceView:
xxoes came through again this week, providing the files needed to compile GtkSourceView on Windows. This helps close the gap between Windows and Linux. GtkSourceView is an extended GtkTextView widget that automatically highlights text based on its syntax. For example, if you tell GtkSourceView that it has XML, it will highlight the elements and attributes to make the text easier to read.

GtkComboBox/GtkTreeView::set_row_separator_func() Patch:
Christian supplied another patch this week to fix the implementation of GtkComboBox::set_row_separator_func() and GtkTreeView::set_row_separator_func(). These two methods are used to add decorative row separators to lists and trees. Basically, the two methods take the name of a callback which is called when each row is rendered. The callback should check the value of the row and return true if the value should be replaced with a row separator (similar to an HTML


element).Documentation

Documentation updates this week:

General

Gnope Game_Of_Life:
Gnope had release a Game of Life package. This is an important release since no programming language is really respected until someone creates a “Game of Life” implemenation. With this package, PHP-GTK 2 now has some street cred. :)

IRC

Animations:
There was a brief discussion on the IRC channel (freenode #php-gtk) this week about using animated images in an application. Showing an animated image is no harder than showing a static image:

< ?php
$win = new GtkWindow();
$win->connect_simple(’destroy’, array(’Gtk’, ‘main_quit’));

$pb = new GdkPixbufAnimation(’/path/to/images/animatedLogo.gif’);
$img = GtkImage::new_from_animation($pb);

$win->add($img);
$win->show_all();

Gtk::main();
?>