/*
 NAME
	ceventtbl.c - source code for CEventTbl class
 VERSION
 	$Id$
 CHANGELOG
 	$Log$
 */

#include <coconut/gtk/ceventtbl.h>
#include <coconut/pcommand.h>

@implementation CEventTbl

- init
{
	clicked_tree = default_tree = nil ;
	return [super init] ;
}

- (void) dealloc
{
	[clicked_tree release] ;
	[default_tree release] ;
	[super dealloc] ;
}

- connectClickedEvent: (id <PWidget>) widget and: (id <PTree>) tree
  with: param
{
	id cmd ;

	if(clicked_tree){
		[clicked_tree release] ; clicked_tree = nil ;
	}
	if(tree && (cmd = [tree rootNode]) != nil){
		clicked_tree = tree ; [clicked_tree retain] ;
		return [widget connectClickedEvent: cmd message:
		  @selector(exec:with:) with: param] ;
	} else
		return nil ;
}

@end

