bug in signal lookup?



Hi
Is it a bug or a feature? To me it looks like a bug.
The following program outputs "signal not found" when you comment out
the dummy gtk_label_new().
Signal creation is done the first time an object is created and there
is no way to force that without creating an object.
Initializing signals in the type_unique or type_create function could be done,
but I guess that is expensive.
There are two solutions to this: have an hook for type generation
(that can be of some use to interpreted languages also) or have a
function that initailizes a class's signals.

lupus

#include <gtk/gtk.h>

int 
main(int argc, char* argv[]){
	gtk_init(&argc, &argv);

	gtk_label_new("Hola");

	if(gtk_signal_lookup ("draw", GTK_TYPE_WIDGET))
		g_message("Found signal\n");
	else
		g_message("Signal not found\n");
	return 0;
}

-- 
"The number of UNIX installations has grown to 10, with more expected."
    - _The UNIX Programmer's Manual_, Second Edition, June, 1972.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]