mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-14 17:01:22 +00:00
8a7fbdfc9f
It currently dies when single stepping or exiting due to EditBuffer's retain count not getting incremented when initialized. This is because EditBuffer is initialized in C and thus does not call Object's -init.
46 lines
661 B
R
46 lines
661 B
R
#include <string.h>
|
|
|
|
#include "ui/group.h"
|
|
#include "ui/titlebar.h"
|
|
|
|
@implementation TitleBar
|
|
|
|
+(TitleBar *)withTitle:(string)title
|
|
{
|
|
return [[[self alloc] initWithTitle:title] autorelease];
|
|
}
|
|
|
|
-initWithTitle:(string) title
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
self.title = title;
|
|
length = strlen (title);
|
|
growMode = gfGrowHiX;
|
|
return self;
|
|
}
|
|
|
|
-setTitle:(string) newTitle
|
|
{
|
|
title = newTitle;
|
|
length = strlen (title);
|
|
[self redraw];
|
|
return self;
|
|
}
|
|
|
|
-setOwner: (Group *) owner
|
|
{
|
|
[super setOwner: owner];
|
|
size = [owner size];
|
|
return self;
|
|
}
|
|
|
|
-draw
|
|
{
|
|
[super draw];
|
|
[self mvaddstr: { (xlen - length) / 2, 0}, title];
|
|
return self;
|
|
}
|
|
|
|
@end
|