X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fwindows.c;h=ef7a30dfade86df3759e6e44c3c0181f90205ed8;hb=7815e738f77aad4e918c84a89aa21f7ae683ebab;hp=86cf1fecde03da528ceec6bab03170c85e68113a;hpb=111279ad59a25bc548c47d38c1a52c3036eff87a;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; }