GtkEditable insert-text signal callback parameters contain GPointer
| From: | Christian Weiske | Date: | Fri, 11 Aug 2006 07:03:52 +0000 |
| Subject: | GtkEditable insert-text signal callback parameters contain GPointer | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-3353@lists.php.net to get a copy of this message | ||
Hello all
The callback for insert-text on GtkEditable should have the following
signature:
php-gtk2:
void callback(string new_text, int new_text_length, int position);
gtk2:
void user_function (GtkEditable *editable,
gchar *new_text,
gint new_text_length,
gint *position,
gpointer user_data);
Now, when using it in code, the fourth parameter is a GPointer. Seems
kinda wrong to me.
<?php
$entry = new GtkEntry();
$entry->connect('insert-text', 'onInsertText', 'test');
function onInsertText($entry, $new_text, $new_text_len, $pos, $userdata)
{
echo $new_text . ':' . $new_text_len . ':' . get_class($pos) . ':'
.
$userdata . "\n";
}
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->add($entry);
$wnd->show_all();
Gtk::main();
?>
--
Regards/MfG,
Christian Weiske
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc