signals returning results
- From: jcupitt gmail com
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: signals returning results
- Date: Sat, 14 Mar 2009 18:14:33 +0000
Hi all,
I'd like to make a signal that can return a bool result. I've defined it with:
progress_signals[SIG_UPDATE] = g_signal_new( "update",
G_OBJECT_CLASS_TYPE( class ),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET( ProgressClass, begin ),
progress_update_accumulate, NULL,
nip_BOOLEAN__INT_INT,
G_TYPE_BOOLEAN, 2,
G_TYPE_INT,
G_TYPE_INT );
but then at runtime I get the message:
(nip2:73155): GLib-GObject-WARNING **: gsignal.c:1287: signal
"Progress::update" has return type `gboolean' and is only
G_SIGNAL_RUN_FIRST
Checking the source, the warning comes from:
if (return_type != G_TYPE_NONE &&
(signal_flags & (G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST |
G_SIGNAL_RUN_CLEANUP)) == G_SIGNAL_RUN_FIRST)
{
g_warning (G_STRLOC ": signal \"%s::%s\" has return type `%s'
and is only G_SIGNAL_RUN_FIRST",
Why can't I make a RUN_FIRST signal that returns a boolean? I can't
see anything in the docs about this.
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]