X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fwindows.c;h=ef7a30dfade86df3759e6e44c3c0181f90205ed8;hb=59ae6cee193bc675cb6f7e80fde3055348c5dc82;hp=86cf1fecde03da528ceec6bab03170c85e68113a;hpb=349ca3893498469b4e002829d9a35da514d8b55d;p=plomrogue
diff --git a/src/windows.c b/src/windows.c
index 86cf1fe..ef7a30d 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -270,6 +270,7 @@ extern struct WinMeta init_win_meta(WINDOW * screen)
extern struct Win init_win(struct WinMeta * wmeta, char * title,
+ uint16_t height, uint16_t width,
void * data, void * func)
{
struct Win w;
@@ -277,10 +278,24 @@ extern struct Win init_win(struct WinMeta * wmeta, char * title,
w.next = 0;
w.frame.curses_win = 0;
w.title = title;
- w.frame.size.x = 20;
- w.frame.size.y = wmeta->padframe.size.y - 1;
w.data = data;
w.draw = func;
+ if (width > 0)
+ {
+ w.frame.size.x = width;
+ }
+ else
+ {
+ w.frame.size.x = 1;
+ }
+ if (height > 0 && height <= wmeta->padframe.size.y - 1)
+ {
+ w.frame.size.y = height;
+ }
+ else
+ {
+ w.frame.size.y = wmeta->padframe.size.y - 1;
+ }
return w;
}