Re: GtkMenu ?

From: Date: Mon, 16 Jul 2001 17:39:34 +0000
Subject: Re: GtkMenu ?
References: 1 2 3 4 5 6 7  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-2212@lists.php.net to get a copy of this message
Hi Andrei > On Mon, 16 Jul 2001, Jonas Delfs wrote: > > I can't make it work. > > But it seemed a bit unclever made too, because the functions i would like to call is in > > the same class. > > Did you make sure to replace $obj with $this in my example? No - i tried with the classname, as you suggested. But i tried that now - without luck. Now i get this error-msg when cliking on "New"(that call newFileInst()) in my menu: <br> <b>Warning</b>: gtklabel() expects argument 1 to be string, integer given in <b>c:\backup\PROGRA~1\php-gtk\edit4-f\edit4-f.php</b> on line <b>78</b><br> <br> <b>Fatal error</b>: Call to a member function on a non-object in <b>c:\backup\PROGRA~1\php-gtk\edit4-f\edit4-f.php</b> on line <b>79</b><br> The call to gtklabel() is in newFileInst() - why does PHP-Gtk give newFileInst() a integer as an argument (it have to do, because i have defined my function with 'function newFileInst($fileName='Not named*'){' and gtklabel() gets called with $fileName as argument). The only integer i can find is the 0 that is given i the item-array. - It just do not help to change 0 to a string i the array-definition. About the second error-msg mentioned above, line 79 looks like this: $this->gui['label']->show(); And the line just above this line, looks like this: $this->gui['label'] = new GtkLabel($fileName); I hope i got it out right. -- Mvh./Best Regards Jonas Delfs, http://delfs.dk

« previous php.gtk (#2212) next »