gtk_scrolled_window_add_with_viewport
| From: | Michael Dransfield | Date: | Fri, 05 Apr 2002 18:05:57 +0000 |
| Subject: | gtk_scrolled_window_add_with_viewport | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-1742@lists.php.net to get a copy of this message | ||
I am trying to populate a scrolled window with a vbox which has a
checkbox for each row of a database result
each time something is added i get this error
Gtk-CRITICAL **: file gtkscrolledwindow.c: line 951
(gtk_scrolled_window_add_with_viewport): assertion `child->parent ==
NULL' failed.
here is the function which generates the error
global $gx;
global $must_array;
global $opt_array;
$must_frame =&
$gx->get_widget("cand_search_skills_must_scrolledwindow");
$opt_frame =& $gx->get_widget("cand_search_skills_opt_scrolledwindow");
$sql = "SELECT * from mytable";
$res = mysql_query($sql);
$must_vbox =& new GtkVBox();
while ($row = mysql_fetch_row($res)){
$must_cb =& new GtkCheckButton($row[1]);
$must_cb->set_data("id", $row[0]);
$must_cb->set_data("level", "must");
$must_cb->get_data("level");
$must_cb->set_active(false);
$must_cb->connect("clicked", "cand_search_check_clicked");
$must_vbox->pack_start($must_cb);
$must_cb->show();
$must_frame->add_with_viewport($must_vbox);
}
$must_vbox->show();
I had problems accessing the vbox directly (i wanted to loop through the
children to see the status of each checkbox) i think it is because i am
using glade. The function get_widget() doesnt seem to return the entire
object with its children, if the children are not present in the glade
file. I can understand why if get_widget relies on the xml file to read
the widget.
The gtk-critical error does not crash the program (in linux, i cant test
my app in windows because of another libglade win32 bug), just reports
this error