Fixed class instantiation.
[ruby-ecore.git] / src / ecore / rb_event_handler.c
index 7d729ae947731fb7752ed1548aaf14de98bbcfca..9a72a0da801cd1badf28eaa604abb70d124f5414 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_event_handler.c 79 2004-08-19 22:20:10Z tilman $
+ * $Id: rb_event_handler.c 343 2005-05-07 20:22:56Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -27,6 +27,8 @@
 #include "rb_ecore.h"
 #include "rb_event_handler.h"
 
+static int on_ecore_event (void *data, int type, void *event);
+
 VALUE event_classes, cEcoreEvent;
 static VALUE handlers;
 
@@ -47,6 +49,8 @@ static VALUE c_init (VALUE self, VALUE type)
 
        rb_ary_push (handlers, self);
 
+       ecore_event_handler_add (t, on_ecore_event, NULL);
+
        return self;
 }
 
@@ -66,7 +70,7 @@ static VALUE c_delete (VALUE self)
        return Qnil;
 }
 
-int on_ecore_event (void *data, int type, void *event)
+static int on_ecore_event (void *data, int type, void *event)
 {
        VALUE handler, klass, obj, argv[1], res;
        int handler_type, len, i;