com gtk/php-gtk: Bug test script for the strange segfault: test/bug_inspector.phpw
[email protected] (David Soria Parra) Sun, 19 Feb 2006 16:49:22 +0000
| Newsgroups | php.gtk.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 849d6d3c9d3fac11aba1bf3cf60eddcfc58856eb Author: Christian Weiske <[email protected]> Sun, 19 Feb 2006 16:49:22 +0000 Parents: db646f7ec2d5f7a9a2cb090ef2822b34761e5af5 Branches: master Link: http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=849d6d3c9d3fac11aba1bf3cf60eddcfc58856eb Log: Bug test script for the strange segfault Changed paths: A test/bug_inspector.phpw Diff: 849d6d3c9d3fac11aba1bf3cf60eddcfc58856eb diff --git a/test/bug_inspector.phpw b/test/bug_inspector.phpw new file mode 100644 index 0000000..8833992 --- /dev/null +++ b/test/bug_inspector.phpw @@ -0,0 +1,32 @@ +<?php +function onClassSelected($selection) +{ + list($model, $iter) = $selection->get_selected(); +} + +$wnd = new GtkWindow(); + +/** +The program segfaults when using the function to + connect. When moving the function content outside, it works. + Very strange. +*/ +function buildGui($wnd) +{ + $model = new GtkListStore(Gtk::TYPE_STRING); + $treeviewClasses = new GtkTreeView($model); + $iter = $model->append(); + $model->set($iter, 0, 'test'); + $treeviewClasses->append_column(new GtkTreeViewColumn('Classes', new GtkCellRendererText(), 'text', 0)); + + $wnd->add($treeviewClasses); + + $selection = $treeviewClasses->get_selection(); + $selection->set_mode(Gtk::SELECTION_SINGLE); + $selection->connect('changed', 'onClassSelected'); +}//protected function buildGui() +buildGui($wnd); + +$wnd->show_all(); +Gtk::main(); +?> \ No newline at end of file