public function addevent($name, $class, $func)
 {
     if (!in_array($name, $this->eventnames)) {
         $this->eventnames[] = $name;
     }
     return parent::addevent($name, $class, $func);
 }