Re: Gtk-CRITICAL gtkbin.c: line 217
| From: | Steph | Date: | Fri, 14 Jun 2002 13:43:29 +0000 |
| Subject: | Re: Gtk-CRITICAL gtkbin.c: line 217 | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2123@lists.php.net to get a copy of this message | ||
did you try making $box global and putting
if($box) $wdwMatch->remove($box)
? - because on the first run, it will return null ...
----- Original Message -----
From: "Miles Phillips" <miles@sag411.com>
To: "Steph" <sfox@php.net>
Cc: <php-gtk-general@lists.php.net>
Sent: Friday, June 14, 2002 2:36 PM
Subject: Re: [PHP-GTK] Gtk-CRITICAL gtkbin.c: line 217
> First off thanks for the suggestions all. Not seeming to have much luck
> with this one though.
> I think I'm just lacking some fundamental knowledge that I maybe should
> have on doing this. I'm going to just paste the effected code in here,
> and let anyone who's willing to hack away at it.
> I've tried the remove, not sure of syntax, but I think this is right,
> right before the $box=&new gtkVbox line...
> $wdwMatch->remove($box)
> It says remove expects 1 argument but null is given.
> If I use $wdwMatch->$box->destroy() it says Fatal Error: Class
> 'GtkWindow' does not support overloaded method calls.
>
> and Alan, I just couldn't really get into your example very well, but
> many thanks for the thought.
>
>
> Global window declaration:
> $wdwMatch=&new gtkWindow();
> $wdwMatch->set_position(GTK_WIN_POS_CENTER);
>
> function insert($seminarId,$att) {
> global $totSa,$totCp, $txtFn,$txtLn,$txtPn,$txtAt,$wdwMatch;
> .
> .
> .
> $wdwMatch->set_default_size(200,400);
> $wdwMatch->set_title("Find the Matching Entry");
> $box= &new gtkVBox();
> $wdwMatch->add($box);
> $table = &new GtkTable(10,$tot);
> $table->set_border_width(5);
> .
> .
> .
> $scrolled_window = &new GtkScrolledWindow();
> $scrolled_window->add_with_viewport($table);
> $btnC=&new gtkButton("Close");
> $btnC->connect_object("clicked","close");
> $box->pack_start($btnC);
> $box->pack_start($scrolled_window);
> $wdwMatch->show_all();
> }
>
> function choose($tableName,$Id,$phone) {
> global $wdwMatch;
> $sql="update $tableName set phone='$phone' where
> Id='$Id'";
> print "$sql\n";
> //query($sql);
> $wdwMatch->hide();
> }
>
> function close() {
> global $wdwMatch;
> $wdwMatch->hide();
> }
>
>
> On Fri, 2002-06-14 at 04:41, Steph wrote:
>
> remove() should have worked .. any clue why it didn't?
>
> ----- Original Message -----
> From: "Miles Phillips" <miles@sag411.com>
> To: "PHP-GTK" <php-gtk-general@lists.php.net>
> Sent: Wednesday, June 12, 2002 3:01 PM
> Subject: [PHP-GTK] Gtk-CRITICAL gtkbin.c: line 217
>
>
> > I have an application I'm working with, that has to show a window, then
> > hide it, then make it reappear at different times. I've declared the
> > window globally then it gets called in one function to populate, then a
> > second function gets it to run its db query, and hide the window. When
> > the window reappears the next time, it comes back with the old content
> > instead of the new and the error Gtk-CRITICAL **: file gtkbin.c: line
> > 217 (gtk_bin_add): assertion `bin->chile == NULL' failed.
> >
> > Which I'm taking to mean that even tho the rest of the widgets weren't
> > declared globally, they are still there? I played around with the
> > remove() function, but didn't seem to get it correct. Would someone
> > mind telling me if my assumption sounds right, and if so, how to correct
> > it?
> >
> > Many thanks,
> >
> > Miles Phillips
> >
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>