quakeforge/ruamoko/gui/Group.r
Bill Currie e472364f51 call [self init] rather than [super init] (and variants where possible) to
ease derived class initialization (all allocation can be done in -init).
Objective-C rocks :)
2004-02-13 02:51:38 +00:00

43 lines
665 B
R

#include "gui/Group.h"
#include "gui/Point.h"
#include "Array.h"
@implementation Group
- (id) init
{
self = [super init];
views = [[Array alloc] init];
return self;
}
- (void) dealloc
{
[views dealloc];
}
- (View) addView: (View)aView
{
[views addItem:aView];
return aView;
}
- (void) moveTo: (integer)x y:(integer)y
{
[self setBasePos: x y:y];
}
- (void) setBasePos: (Point) pos
{
[super setBasePos:pos];
local Point point = [[Point alloc] initWithComponents:xabs :yabs];
[views makeObjectsPerformSelector:@selector (setBasePos:) withObject:point];
[point dealloc];
}
- (void) draw
{
[views makeObjectsPerformSelector:@selector (draw)];
}
@end