[qwaq] Use the now working compound init more

This commit is contained in:
Bill Currie 2020-03-13 10:00:05 +09:00
parent 8d10b0f4aa
commit 6001abbfdb
2 changed files with 6 additions and 8 deletions

View file

@ -31,14 +31,12 @@ makeRect (int xpos, int ypos, int xlen, int ylen)
Point makePoint (int x, int y)
{
Point p = {x, y};
return p;
return {x, y};
}
Extent makeExtent (int width, int height)
{
Extent e = {width, height};
return e;
return {width, height};
}
int

View file

@ -21,10 +21,10 @@
buffer = [[TextContext alloc] initWithRect: rect];
textContext = buffer;
panel = create_panel ([buffer window]);
buf = [DrawBuffer buffer: makeExtent (3, 3)];
[buf mvaddstr: makePoint (0, 0), "XOX"];
[buf mvaddstr: makePoint (0, 1), "OXO"];
[buf mvaddstr: makePoint (0, 2), "XOX"];
buf = [DrawBuffer buffer: {3, 3}];
[buf mvaddstr: {0, 0}, "XOX"];
[buf mvaddstr: {0, 1}, "OXO"];
[buf mvaddstr: {0, 2}, "XOX"];
return self;
}