Scintilla Weirds from a callback?
| From: | Benjamin Smith | Date: | Wed, 22 Feb 2006 04:46:30 +0000 |
| Subject: | Scintilla Weirds from a callback? | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-6770@lists.php.net to get a copy of this message | ||
I'm trying to "correct" certain text as it is entered into a GtkScintilla
widget under PHP-GTK 4.x/GTK 1.3. I've boiled it down to its irreducable
minimum: for some reason, the Set_Text() inside the callback fails
completely!
I've tried update screen, hide()+show(), Select_All() + Cut(), and just about
everything else I can think of. Any idea why this won't update the
GtkScintillia Widget from inside the callback function? (but seems to, just
fine, everywhere else!)
Function UpdateTheText($widget)
{
$text=$widget->Get_Text();
Report("UpdateTheText($text)", 1);
if ($text!=($newtext=str_replace('damn', '----', $text)) )
{
$signal=$widget->Get_Data('signal');
$widget->Signal_Handler_Block($signal);
$widget->Set_Text($newtext);
$widget->Signal_Handler_Unblock($signal);
}
return true;
}
$n=DefaultScintilla();
$signal=$n->Connect('modified', 'UpdateTheText');
$n->Set_Data('signal', $signal);
$w=&New GtkWindow();
$w->Add($n);
$w->Show_All();
Any input would be GREATLY appreciated...
-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978