Re: GtkCList recreation only once.
| From: | Steph | Date: | Thu, 03 Oct 2002 14:23:51 +0000 |
| Subject: | Re: GtkCList recreation only once. | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2505@lists.php.net to get a copy of this message | ||
Don't remove the list. Use clear() instead.
----- Original Message -----
From: "Robert Sedlacek" <phaylon@gmx.at>
To: <php-gtk-general@lists.php.net>
Sent: Thursday, October 03, 2002 1:04 PM
Subject: [PHP-GTK] GtkCList recreation only once.
> Ok, here's my scenario:
>
> $listErgebnis = $glade_app->get_widget('listErgebnis');
> // stands right bevor app_init(); this is the list, wherein the result
> // should be displayed. this happens in global namespace, cause I dont
> // believe, that i'll find it, after recreation, with get_widget.
>
> I've got a Textfield for entering a MySQL-Query, the query is sent to
the
> server, brings back the information, then:
>
> global $listErgebnis;
> // gets the list into function namespace
> $scw2->remove($listErgebnis);
> // removes the list from the scrolledwindow (scw2 is the pointer to
this
> // ScrollingWindow)
> for($i=0;$i<mysql_num_fields($result);$i++) {
> $fnames[] = mysql_field_name($result,$i);
> }
> // get's the field-names into an array
> $listErgebnis = &new GtkCList(mysql_num_fields($result),$fnames);
> // creates a new GTKCList
> $scw2->add($listErgebnis);
> // and adds it to the scrollwin
> $listErgebnis->show();
> // this one shows it
>
> after that the list is filled with the values.
>
> All that works perfect, but only one time! after the second try, i
> get an
>
> Gtk-CRITICAL **: file gtkcontainer.c: line 730 (gtk_container_remove):
> assertion `widget->parent == GTK_WIDGET (container)' failed.
>
> Gtk-CRITICAL **: file gtkscrolledwindow.c: line 899
> (gtk_scrolled_window_add): assertion `bin->child == NULL' failed.
>
> Any Idea's someone?
>
> Robert
>
> --
> Das Gefängnis ist in deinem Kopf,
> könnt ihr nicht sehen, dass ich frei bin?
>
> - Charles Manson
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>