Re: $text->insert( ... - Drives me Nuts

From: Date: Wed, 14 Feb 2024 13:40:18 +0000
Subject: Re: $text->insert( ... - Drives me Nuts
Groups: php.gtk 
Request: Send a blank email to php-gtk+get-1002@lists.php.net to get a copy of this message
use insert_text() instead, much easier, tho you dont have control over the font. I was also unable to get it to work using fonts. $line being the text to insert. $text->freeze(); $position = 0; $text->insert_text($line, strlen($line), $position); $text->thaw(); > I'm trying to get some text to insert into a text area. I keep getting > the error message: > > insert() expects argument 1 to be gdkfont, string given in > <b>note.php</b> on line <b>47</b><br> > > for the following: > > $text = & new GtkText(); > $text->freeze(); > $text->set_editable(TRUE); > $text->insert(defaultfont, $text->style->black, NULL,$labeltext,-1); > $text->thaw(); > $text->show(); > > > > If I change > > $text->insert(defaultfont, $text->style->black, > NULL,$labeltext,-1); > > to: > > $text->insert(NULL, $text->style->black, NULL,$labeltext,-1); > > I get this error: > > <b>Warning</b>: insert() expects argument 1 to be gdkfont, > NULL given in <b>note.php</b> on line <b>47</b><br> > > Now if NULL isn't NULL, what is. > > Thanks in advance > > Martin Cameron

« previous php.gtk (#1002) next »