PHP-GTK News #8

This week’s big news, documentation. When I came into work Monday morning, I had 106 new messages in my Docs inbox. That is 106 messages from Friday evening to Monday morning! That is a lot of activity.

Development

Patches applied by Andrei:
GtkWidget::set_visible() (Scott) - It is now possible to set the visibility of a wiget with just one call. You can show a widget using $widget->set_visible(true). You can hide it using $widget->set_visible(false). I tried writing this patch a few weeks ago but ran into some trouble. The key is to use zend_bool not gboolean.
GtkAboutDialog (Anant) - This patch fixes the get and set methods for aurthors, artists, and documentors.

New imagebrowser.php Demo:
Christian added a new demo to the demos/ directory. This application shows a list of previews for images in a directory and shows the selected image. Here is a screen shot of the app in action.

GtkTreeModel::set_column_types() Patch:
Andrei applied a patch to GtkTreeStore and GtkListStore. This patch allows for dynamically setting column types. It is useful if you need to create lists and trees on the fly. You can now do something like this:

$store = new GtkListStore();
$store->set_column_types(array(Gtk:TYPE_STRING, Gtk::TYPE_LONG));

More GdkPixbuf Patches:
The get_pixel, put_pixel, fill_area, save patches mentioned in earlier postings have been applied.

GtkRadioButton::get_group() Patch (Anant):
Anant has supplied a patch that fixes the implementation of GtkRadioButton::get_group(). This patch has not yet been applied.

Documentation

Doc updates:

Updates to the build process:
Andrei added the ability to make the docs as plain text. All you have to do is type: make text
Steph added the ability to make a small and quick test build of just one section. Here are two example runs:

$> make test id=tutorials.helloadvanced
/cygdrive/c/WINDOWS/xsltproc –param base.dir “‘testbuild/’” –stringparam rootid “tutorials.helloadvanced” –xinclude ./stylesheets/html/chunk.xsl ./scripts/manual.xml
Writing testbuild/tutorials.helloadvanced.html for chapter(tutorials.helloadvanced)

$> make test id=gtk.gtkbuttonbox
/cygdrive/c/WINDOWS/xsltproc –param base.dir “‘testbuild/’” –stringparam rootid “gtk.gtkbuttonbox” –xinclude ./stylesheets/html/chunk.xsl ./scripts/manual.xml
Writing testbuild/gtk.gtkbuttonbox.method.get_child_ipadding.html for method(gtk.gtkbuttonbox.method.get_child_ipadding)
Writing testbuild/gtk.gtkbuttonbox.method.get_child_secondary.html for method(gtk.gtkbuttonbox.method.get_child_secondary)
Writing testbuild/gtk.gtkbuttonbox.method.get_child_size.html for method(gtk.gtkbuttonbox.method.get_child_size)

pt_BR open for business:
The build process is now pretty stable. Because of this we can not only work on the regular documentation but also on translations. The Brazilian Portugese section is now ready for files to be committed.

General

Doc updates list active again:
The list of updates on the PHP-GTK homepage is now live again. Every night when the docs are rebuilt, the list will be updated. You can use that list to keep up to date on the latest documenation changes.

GtkTextBuffer
- Get cursor position:
Sean Coates asked how to get the current cursor position in a GtkTextView. The answer is, you can’t. The cursor is part of GtkTextBuffer not GtkTextView. In order to get the position from the buffer, you need to take two steps. First get the insert mark using get_insert() and then get the iterator at that mark using get_iter_at_mark(). Alternatively, if you are just looking for a way to insert text at the cursor on the fly, you can use insert_at_cursor().

IRC

Setting a GtkNotebook page:
Scoates was having trouble setting the page of a GtkNotebook that he wanted displayed on startup. He was trying something like this:

$nb = new GtkNotebook();
$page1 = $nb->append_page(new GtkLabel(’Test1′), new GtkLabel(’Test1′));
$page2 = $nb->append_page(new GtkLabel(’Test2′), new GtkLabel(’Test2′));
$nb->set_current_page($page2);

Even though he was setting the second page as the current page, when he showed the notebook, the first page was still showing up. The key is that you cannot set the current page until the notebook is realized.

PEAR

Releases:
Gtk2_EntryDialog: fixed speling in setRefaultResonse() to setDefaultResponse()

One Response to “PHP-GTK News #8”

  1. kbglob - tecnologia para geeks, no para tu mamá » Avances de PHP-GTK Says:

    […] Contrario a lo que yo pensaba, PHP-GTK esta avanzando muchisimo. PHP-GTK es una extensión para PHP que implementa toda la interfáz GTK (Gnome) para poder crear interfaces de usuarios a través de este método. De a poco empieza a aparecer mucha más variedad de implementaciones para generar interfaces de usuarios para los lenguajes de scripting web (ej. XUL). Se de alguno que intento hace un tiempo hacer algo con esto y no le fué muy bien. Se rumorea que hay mucha mas documentación y mejoras. […]

Leave a Reply