From 889babd996ed238ec076cf64264b069984fb1fa7 Mon Sep 17 00:00:00 2001 From: ewt Date: Fri, 12 Sep 1997 15:50:22 +0000 Subject: [PATCH] added first newtWin*() functions, added newtReflowText() --- newt.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/newt.h b/newt.h index f0d65c8..7c1fbad 100644 --- a/newt.h +++ b/newt.h @@ -5,6 +5,8 @@ extern "C" { #endif +#include + #define NEWT_COLORSET_ROOT 2 #define NEWT_COLORSET_BORDER 3 #define NEWT_COLORSET_WINDOW 4 @@ -151,6 +153,8 @@ newtComponent newtTextbox(int left, int top, int with, int height, int flags); void newtTextboxSetText(newtComponent co, const char * text); void newtTextboxSetHeight(newtComponent co, int height); int newtTextboxGetNumLines(newtComponent co); +char * newtReflowText(char * text, int width, int flexDown, int flexUp, + int * actualWidth, int * actualHeight); struct newtExitStruct { enum { NEWT_EXIT_HOTKEY, NEWT_EXIT_COMPONENT } reason; @@ -243,6 +247,17 @@ void newtGridFree(newtGrid grid, int recurse); void newtGridGetSize(newtGrid grid, int * width, int * height); void newtGridWrappedWindow(newtGrid grid, char * title); +/* automatically centered and shrink wrapped */ +void newtWinMessage(char * title, char * buttonText, char * text, ...); +void newtWinMessagev(char * title, char * buttonText, char * text, + va_list argv); + +/* Returns 0 if button 1 is pressed, 1 if button2 is pressed, 2 if F12 + is pressed. If button2 is NULL, this behaves like newtWinMessage */ +int newtWinChoice(char * title, char * button1, char * button2, + char * text, ...); + + #ifdef __cplusplus } /* End of extern "C" { */ #endif -- 2.39.2