PHP-GTK News #10
Another slower week for PHP-GTK as people, myself included, tend to the work that pays the bills.
Development
Planned Patches for Alpha Release:
Last week a rough release plan was announced for PHP-GTK 2 alpha1. Part of this plan included applying a few patches. This week Andrei gave us a list of the patches that he hopes to apply:
- PangoAttribute support.
- GtkRadioButton::get_group (and maybe related ones). (Applied 2006-04-23)
- GtkAboutDialog::get/set_website_label
- GtkPlug/GtkSocket (Applied 2006-04-24)
- Scintilla extension.
- GtkTreeModel::iter_parent, iter_n_children and any additional ones that are easy to implement.
General
New book on PHP-GTK 2 available:
As was posted earlier this week, “Pro PHP-GTK” is now available. This is the first an only book to cover PHP-GTK 2 in detail. Details can be found in the previous post.
Context menus in GtkTreeView:
Christian was having some trouble creating context menus for selected rows in a GtkTreeView. Fortunately, he was able to solve the problem himself. Here is a section of his one-man email thread:
I have a GtkTreeView and connect “button-press-event” to show a context
menu for the currently selected row.
The popup works, but I get the previously selected row only - not the
one that is (newly) selected when I right-click the list.
An example code is here:
http://xml.cweiske.de/rightclicktree.phps
Just run it and right-click a not selected item; the popup will show the
value of the selection - which is always the old one, not the new selection.
Does anyone know how to get the new selection data?
connect_after doesn’t work here.
———
While writing this mail the idea to use “button-release-event” crossed
my mind and it works. Thanks for reading :)
PHP-GTK RAD tool:
ANUBIS, a RAD tool for PHP-GTK, was released this week. That is all I can say about it because I only read English. If someone has more details please feel free to post them in a comment below. For those who are multi-lingual, details can fe found at www.zendrael.com.
PEAR
Added to PEAR:
Structures_Form_Gtk2: This packaeg provides PHP-GTK 2 elements for Structures_Form (also accpeted into PEAR this week). Along with Sturctures_Form, this package allows generic forms to be created independant of the UI.
On a personal note, I would like to serve fair warning that either next week or the week after, news will not be posted as my first child will be born shortly and I probably won’t be near a computer. I will do my best to make sure that the follow week’s news covers everything in the two week span. News posting will continue on the regular schedule after the one week break.

April 26th, 2006 at 3:10 pm
All the very best for the new chapter in your life, and, Congratulations!
April 26th, 2006 at 6:42 pm
Congratulations on the new little coder! Make his or her first utterance be “
April 26th, 2006 at 6:43 pm
Ooops… forgot about stripping out HTML chars… that was supposed to be, “PHP!” :)
May 12th, 2006 at 5:24 am
Hi, ive the same problem with “move-cursor” in GtkTreeView. If i connect this, the callback function gets the last selected row instead of the current selected row.
$this->lst_items->connect(”move-cursor”, array($this, ’show_media_info’));
public function show_media_info($obj, $bla1, $bal2) {
$data = $obj->get_selection();
list($model, $iter) = $data->get_selected();
$name = $model->get_value($iter, 1);
}
…
how can i fix this… wil this be fixed in one of the next releases?
Regards,
andreas
May 12th, 2006 at 5:55 am
@andreas: This is nothing that can be fixed by PHP-Gtk, it’s a Gtk problem. Perhaps connect_after() works?