"====================================================================== | | newt c wrapper | | ======================================================================" "====================================================================== | | Copyright 2006 Free Software Foundation, Inc. | Written by Brad Watson | | This file is part of GNU Smalltalk. | | GNU Smalltalk is free software; you can redistribute it and/or modify it | under the terms of the GNU General Public License as published by the Free | Software Foundation; either version 2, or (at your option) any later version. | | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | details. | | You should have received a copy of the GNU General Public License along with | GNU Smalltalk; see the file COPYING. If not, write to the Free Software | Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ======================================================================" "====================================================================== | | Notes: implemented without callbacks. See the newt man pages | for a description of the wrapped newt library functions. | ======================================================================" Object subclass: #Newt instanceVariableNames: '' classVariableNames: 'StdScreen' poolDictionaries: '' category: 'Newt Wrapper'! DLD addLibrary: 'libnewt'! !Newt class methodsFor: 'Constants'! anchorBottom "#define NEWT_ANCHOR_BOTTOM (1 << 3)" ^16r0008! anchorLeft "#define NEWT_ANCHOR_LEFT (1 << 0)" ^16r0001! anchorRight "#define NEWT_ANCHOR_RIGHT (1 << 1)" ^16r0002! anchorTop "#define NEWT_ANCHOR_TOP (1 << 2)" ^16r0004! checkBoxTreeCollapsed "#define NEWT_CHECKBOXTREE_COLLAPSED '\0'" ^Char asciiValue: 0! checkBoxTreeExpanded "#define NEWT_CHECKBOXTREE_EXPANDED '\1'" ^Char asciiValue: 1! checkBoxTreeHideBox "#define NEWT_CHECKBOXTREE_HIDE_BOX (1 << 13)" ^8192! checkBoxTreeSelected "#define NEWT_CHECKBOXTREE_SELECTED '*'" ^$*! checkBoxTreeUnselectable "#define NEWT_CHECKBOXTREE_UNSELECTABLE (1 << 12)" ^4096! checkBoxTreeUnselected "#define NEWT_CHECKBOXTREE_UNSELECTED ' '" ^Char space! colorSetActButton "#define NEWT_COLORSET_ACTBUTTON 8" ^8! colorSetActCheckBox "#define NEWT_COLORSET_ACTCHECKBOX 10" ^10! colorSetActListbox "#define NEWT_COLORSET_ACTLISTBOX 14" ^14! colorSetActSelListBox "#define NEWT_COLORSET_ACTSELLISTBOX 23" ^23! colorSetActTextBox "#define NEWT_COLORSET_ACTTEXTBOX 16" ^16! colorSetBorder "#define NEWT_COLORSET_BORDER 3" ^3! colorSetButton "#define NEWT_COLORSET_BUTTON 7" ^7! colorSetCheckBox "#define NEWT_COLORSET_CHECKBOX 9" ^9! colorSetCompactButton "#define NEWT_COLORSET_COMPACTBUTTON 22" ^22! colorSetDisEntry "#define NEWT_COLORSET_DISENTRY 21" ^21! colorSetEmptyScale "#define NEWT_COLORSET_EMPTYSCALE 19" ^19! colorSetEntry "#define NEWT_COLORSET_ENTRY 11" ^11! colorSetFullScale "#define NEWT_COLORSET_FULLSCALE 20" ^20! colorSetHelpLine "#define NEWT_COLORSET_HELPLINE 17" ^17! colorSetLabel "#define NEWT_COLORSET_LABEL 12" ^12! colorSetListBox "#define NEWT_COLORSET_LISTBOX 13" ^13! colorSetRoot "#define NEWT_COLORSET_ROOT 2" ^2! colorSetRootText "#define NEWT_COLORSET_ROOTTEXT 18" ^18! colorSetSelListBox "#define NEWT_COLORSET_SELLISTBOX 24" ^24! colorSetShadow "#define NEWT_COLORSET_SHADOW 5" ^5! colorSetTextBox "#define NEWT_COLORSET_TEXTBOX 15" ^15! colorSetTitle "#define NEWT_COLORSET_TITLE 6" ^6! colorSetWindow "#define NEWT_COLORSET_WINDOW 4" ^4! entryDisabled "#define NEWT_ENTRY_DISABLED NEWT_FLAG_DISABLED" ^self flagDisabled! entryHidden "#define NEWT_ENTRY_HIDDEN NEWT_FLAG_HIDDEN" ^self flagHidden! entryReturnExit "#define NEWT_ENTRY_RETURNEXIT NEWT_FLAG_RETURNEXIT" ^self flagReturnExit! entryScroll "#define NEWT_ENTRY_SCROLL NEWT_FLAG_SCROLL" ^self flagScroll! fdRead "#define NEWT_FD_READ (1 << 0)" ^1! fdWrite "#define NEWT_FD_WRITE (1 << 1)" ^2! fdExcept "#define NEWT_FD_EXCEPT (1 << 2)" ^4! flagBorder "#define NEWT_FLAG_BORDER (1 << 5)" ^32! flagCheckBox "#define NEWT_FLAG_CHECKBOX (1 << 10)" ^1024! flagDisabled "#define NEWT_FLAG_DISABLED (1 << 3)" ^8! flagHidden "#define NEWT_FLAG_HIDDEN (1 << 1)" ^2! flagMultiple "#define NEWT_FLAG_MULTIPLE (1 << 8)" ^256! flagNoF12 "#define NEWT_FLAG_NOF12 (1 << 7)" ^128! flagPassword "#define NEWT_FLAG_PASSWORD (1 << 11)" ^2048! flagReturnExit "#define NEWT_FLAG_RETURNEXIT (1 << 0)" ^1! flagSelected "#define NEWT_FLAG_SELECTED (1 << 9)" ^512! flagScroll "#define NEWT_FLAG_SCROLL (1 << 2)" ^4! flagShowCursor "#define NEWT_FLAG_SHOWCURSOR (1 << 12)" ^4096! flagWrap "#define NEWT_FLAG_WRAP (1 << 6)" ^64! formNoF12 "#define NEWT_FORM_NOF12 NEWT_FLAG_NOF12" ^self flagNoF12! gridFlagGrowX "#define NEWT_GRID_FLAG_GROWX (1 << 0)" ^16r0001! gridFlagGrowY "#define NEWT_GRID_FLAG_GROWY (1 << 1)" ^16r0002! keyBkSpc "#define NEWT_KEY_BKSPC NEWT_KEY_EXTRA_BASE + 6" ^self keyExtraBase + 6! keyDelete "#define NEWT_KEY_DELETE NEWT_KEY_EXTRA_BASE + 7" ^self keyExtraBase + 7! keyDown "#define NEWT_KEY_DOWN NEWT_KEY_EXTRA_BASE + 2" ^self keyExtraBase + 2! keyEnd "#define NEWT_KEY_END NEWT_KEY_EXTRA_BASE + 9" ^self keyExtraBase + 9! keyEnter ^Char lf! keyEscape ^Char asciiValue: 27! keyExtraBase "#define NEWT_KEY_EXTRA_BASE 0x8000" ^16r8000! keyF1 "#define NEWT_KEY_F1 NEWT_KEY_EXTRA_BASE + 101" ^self keyExtraBase + 101! keyF2 "#define NEWT_KEY_F2 NEWT_KEY_EXTRA_BASE + 102" ^self keyExtraBase + 102! keyF3 "#define NEWT_KEY_F3 NEWT_KEY_EXTRA_BASE + 103" ^self keyExtraBase + 103! keyF4 "#define NEWT_KEY_F4 NEWT_KEY_EXTRA_BASE + 104" ^self keyExtraBase + 104! keyF5 "#define NEWT_KEY_F5 NEWT_KEY_EXTRA_BASE + 105" ^self keyExtraBase + 105! keyF6 "#define NEWT_KEY_F6 NEWT_KEY_EXTRA_BASE + 106" ^self keyExtraBase + 106! keyF7 "#define NEWT_KEY_F7 NEWT_KEY_EXTRA_BASE + 107" ^self keyExtraBase + 107! keyF8 "#define NEWT_KEY_F8 NEWT_KEY_EXTRA_BASE + 108" ^self keyExtraBase + 108! keyF9 "#define NEWT_KEY_F9 NEWT_KEY_EXTRA_BASE + 109" ^self keyExtraBase + 109! keyF10 "#define NEWT_KEY_F10 NEWT_KEY_EXTRA_BASE + 110" ^self keyExtraBase + 110! keyF11 "#define NEWT_KEY_F11 NEWT_KEY_EXTRA_BASE + 111" ^self keyExtraBase + 111! keyF12 "#define NEWT_KEY_F12 NEWT_KEY_EXTRA_BASE + 112" ^self keyExtraBase + 112! keyHome "#define NEWT_KEY_HOME NEWT_KEY_EXTRA_BASE + 8" ^self keyExtraBase + 8! keyInsert "#define NEWT_KEY_INSERT NEWT_KEY_EXTRA_BASE + 13" ^self keyExtraBase + 13! keyLeft "#define NEWT_KEY_LEFT NEWT_KEY_EXTRA_BASE + 4" ^self keyExtraBase + 4! keyResize "#define NEWT_KEY_RESIZE NEWT_KEY_EXTRA_BASE + 113" ^self keyExtraBase + 113! keyRight "#define NEWT_KEY_RIGHT NEWT_KEY_EXTRA_BASE + 5" ^self keyExtraBase + 5! keyReturn "#define NEWT_KEY_RETURN NEWT_KEY_ENTER" ^self keyEnter! keyPgup "#define NEWT_KEY_PGUP NEWT_KEY_EXTRA_BASE + 11" ^self keyExtraBase + 12! keyPgdn "#define NEWT_KEY_PGDN NEWT_KEY_EXTRA_BASE + 12" ^self keyExtraBase + 12! keyTab ^Char tab! keyUntab "#define NEWT_KEY_UNTAB NEWT_KEY_EXTRA_BASE + 10" ^self keyExtraBase + 10! keyUp "#define NEWT_KEY_UP NEWT_KEY_EXTRA_BASE + 1" ^self keyExtraBase + 1! keySuspend ^Char asciiValue: 32! listBoxReturnExit "#define NEWT_LISTBOX_RETURNEXIT NEWT_FLAG_RETURNEXIT" ^self flagReturnExit! newtArgAppend "#define NEWT_ARG_APPEND -1" ^-1! newtArgLast "#define NEWT_ARG_LAST -100000" ^-100000! textBoxScroll "#define NEWT_TEXTBOX_SCROLL NEWT_FLAG_SCROLL" ^self flagScroll! textBoxWrap "#define NEWT_TEXTBOX_WRAP NEWT_FLAG_WRAP" ^self flagWrap! !Newt class methodsFor: 'C call-outs'! bell "void newtBell(void);" ! button: anInt1 top: anInt2 text: aString "newtComponent newtButton(int left, int top, const char * text);" ! buttonBar: aString blcomp: anObject "newtGrid newtButtonBar(char * button1, newtComponent * b1comp, ...);" ! buttonBarV: aString blcomp: anObject args: variadic "newtGrid newtButtonBarv(char * button1, newtComponent * b1comp, va_list args);" ! centeredWindow: aUnit1 height: aUint2 title: aString "int newtCenteredWindow(unsigned int width, unsigned int height, const char * title);" ! checkBox: anInt1 top: anInt2 text: aString1 defValue: aChar seq: aString2 result: aString3 "newtComponent newtCheckbox(int left, int top, const char * text, char defValue, const char * seq, char * result);" ! checkBoxGetValue: anObject "char newtCheckboxGetValue(newtComponent co);" ! checkBoxSetFlags: anObject flags: anInt1 sense: anInt2 "void newtCheckboxSetFlags(newtComponent co, int flags, enum newtFlagsSense sense);" ! checkBoxSetValue: anObject value: aChar "void newtCheckboxSetValue(newtComponent co, char value);" ! checkBoxTree: anInt1 top: anInt2 height: anInt3 flags: anInt4 "newtComponent newtCheckboxTree(int left, int top, int height, int flags);" ! checkBoxTreeAddArray: anObject1 text: aString data: anObject2 flags: anInt1 indexes: anObject3 "int newtCheckboxTreeAddArray(newtComponent co, const char * text, const void * data, int flags, int * indexes);" ! checkBoxTreeAddItem: anObject1 text: aString data: anObject2 flags: anInt1 index: anInt2 "int newtCheckboxTreeAddItem(newtComponent co, const char * text, const void * data, int flags, int index, ...);" ! checkBoxTreeAddItem: anObject1 text: aString data: anObject2 flags: anInt1 index: anInt2 args: aVariadic "int newtCheckboxTreeAddItem(newtComponent co, const char * text, const void * data, int flags, int index, ...);" ! checkBoxTreeFindItem: anObject1 data: anObject2 "int * newtCheckboxTreeFindItem(newtComponent co, void * data);" ! checkBoxTreeGetCurrent: anObject "const void * newtCheckboxTreeGetCurrent(newtComponent co);" ! checkBoxTreeGetEntryValue: anObject1 data: anObject2 "char newtCheckboxTreeGetEntryValue(newtComponent co, const void * data);" ! checkBoxTreeGetMultiSelection: anObject1 numItems: anObject2 seqNum: aChar "const void ** newtCheckboxTreeGetMultiSelection(newtComponent co, int *numitems, char seqnum);" ! checkBoxTreeGetSelection: anObject numitems: anInt "const void ** newtCheckboxTreeGetSelection(newtComponent co, int *numitems);" ! checkBoxTreeMulti: anInt1 top: anInt2 height: anInt3 seq: aString flags: anInt4 "newtComponent newtCheckboxTreeMulti(int left, int top, int height, char *seq, int flags);" ! checkBoxTreeSetCurrent: anObject1 item: anObject2 "void newtCheckboxTreeSetCurrent(newtComponent co, void * item);" ! checkBoxTreeSetEntry: anObject1 data: anObject2 text: anObject3 "void newtCheckboxTreeSetEntry(newtComponent co, const void * data, const char * text);" ! checkBoxTreeSetEntryValue: anObject1 data: anObject2 value: aChar "void newtCheckboxTreeSetEntryValue(newtComponent co, const void * data, char value);" ! checkBoxTreeSetWidth: anObject width: anInt "void newtCheckboxTreeSetWidth(newtComponent co, int width);" ! clearKeyBuffer "void newtClearKeyBuffer(void);" ! cls "void newtCls(void);" ! componentAddCallback: anObject1 f: anObject2 data: anObject3 "void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);" ! compactButton: anInt1 top: anInt2 text: aString "newtComponent newtCompactButton(int left, int top, const char * text);" ! componentTakesFocus: anObject val: anInt "void newtComponentTakesFocus(newtComponent co, int val);" ! createGrid: anInt1 rows: anInt2 "newtGrid newtCreateGrid(int cols, int rows);" ! cursorOff "void newtCursorOff(void);" ! cursorOn "void newtCursorOn(void);" ! delay: anInt "void newtDelay(unsigned int usecs);" ! drawForm: anObject "void newtDrawForm(newtComponent form);" ! drawRootText: anInt1 row: anInt2 text: aString "void newtDrawRootText(int col, int row, const char * text);" ! entry: anInt1 top: anInt2 initialValue: aString width: anInt3 resultPtr: anObject1 flags: anInt4 "newtComponent newtEntry(int left, int top, const char * initialValue, int width, const char ** resultPtr, int flags);" ! entryGetValue: anObject "char * newtEntryGetValue(newtComponent co);" ! entrySet: anObject value: aString cursorAtEnd: anInt "void newtEntrySet(newtComponent co, const char * value, int cursorAtEnd);" ! entrySetFilter: anObject1 filter: anObject2 data: anObject3 "void newtEntrySetFilter(newtComponent co, newtEntryFilter filter, void * data);" ! entrySetFlags: anObject flags: anInt1 sense: anInt2 "void newtEntrySetFlags(newtComponent co, int flags, enum newtFlagsSense sense);" ! finished "int newtFinished(void);" ! form: anObject1 helpTag: anObject2 flags: anInt "newtComponent newtForm(newtComponent vertBar, void * helpTag, int flags);" ! formAddComponent: anObject1 co: anObject2 "void newtFormAddComponent(newtComponent form, newtComponent co);" ! formAddComponents: anObject "void newtFormAddComponents(newtComponent form, ...);" ! formAddComponents: anObject args: aVariadic "void newtFormAddComponents(newtComponent form, ...);" ! formAddHotKey: anObject key: anInt "void newtFormAddHotKey(newtComponent co, int key);" ! formDestroy: anObject "void newtFormDestroy(newtComponent form);" ! formGetCurrent: anObject "newtComponent newtFormGetCurrent(newtComponent co);" ! formRun: anObject1 newtExitStructure: anObject2 "void newtFormRun(newtComponent co, struct newtExitStruct * es);" ! formSetBackground: anObject color: anInt "void newtFormSetBackground(newtComponent co, int color);" ! formSetCurrent: anObject1 subco: anObject2 "void newtFormSetCurrent(newtComponent co, newtComponent subco);" ! formSetHeight: anObject height: anInt "void newtFormSetHeight(newtComponent co, int height);" ! formSetSize: anObject "void newtFormSetSize(newtComponent co);" ! formSetTimer: anObject milliSecs: anInt "void newtFormSetTimer(newtComponent form, int millisecs);" ! formSetWidth: anObject width: anInt "void newtFormSetWidth(newtComponent co, int width);" ! formWatchFd: anObject fd: anInt1 fdFlags: anInt2 "void newtFormWatchFd(newtComponent form, int fd, int fdFlags);" ! gridAddComponentsToForm: anObject1 form: anObject2 recurse: anInt "void newtGridAddComponentsToForm(newtGrid grid, newtComponent form, int recurse);" ! gridBasicWindow: anObject1 middle: anObject2 buttons: anObject3 "newtGrid newtGridBasicWindow(newtComponent text, newtGrid middle, newtGrid buttons);" ! gridFree: anObject recurse: anInt "void newtGridFree(newtGrid grid, int recurse);" ! gridGetSize: anObject1 width: anObject2 height: anObject3 "void newtGridGetSize(newtGrid grid, int * width, int * height);" ! gridHCloseStacked: anInt what: anObject "newtGrid newtGridHCloseStacked(enum newtGridElement type1, void * what1, ...);" ! gridHCloseStacked: anInt what: anObject args: aVariadic "newtGrid newtGridHCloseStacked(enum newtGridElement type1, void * what1, ...);" ! gridHStacked: anInt what: anObject "newtGrid newtGridHStacked(enum newtGridElement type1, void * what1, ...);" ! gridHStacked: anInt what: anObject args: aVariadic "newtGrid newtGridHStacked(enum newtGridElement type1, void * what1, ...);" ! gridSetField: anObject1 col: anInt1 row: anInt2 type: anInt3 val: anObject2 padLeft: anInt4 padTop: anInt5 padRight: anInt6 padBottom: anInt7 anchor: anInt8 flags: anInt9 "void newtGridSetField(newtGrid grid, int col, int row, enum newtGridElement type, void * val, int padLeft, int padTop, int padRight, int padBottom, int anchor, int flags);" ! getScreenSize: anObject1 rows: anObject2 "void newtGetScreenSize(int * cols, int * rows);" ! gridSimpleWindow: anObject1 middle: anObject2 buttons: amObject3 "newtGrid newtGridSimpleWindow(newtComponent text, newtComponent middle, newtGrid buttons);" ! gridPlace: anObject left: anInt1 top: anInt2 "void newtGridPlace(newtGrid grid, int left, int top);" ! gridVCloseStacked: anInt what: anObject "newtGrid newtGridVCloseStacked(enum newtGridElement type, void * what, ...);" ! gridVCloseStacked: anInt what: anObject args: aVariadic "newtGrid newtGridVCloseStacked(enum newtGridElement type, void * what, ...);" ! gridVStacked: anInt what: anObject "newtGrid newtGridVStacked(enum newtGridElement type, void * what, ...);" ! gridVStacked: anInt what: anObject args: aVariadic "newtGrid newtGridVStacked(enum newtGridElement type, void * what, ...);" ! gridWrappedWindow: anObject title: aString "void newtGridWrappedWindow(newtGrid grid, char * title);" ! gridWrappedWindowAt: anObject title: aString left: anInt1 top: anInt2 "void newtGridWrappedWindowAt(newtGrid grid, char * title, int left, int top);" ! init "int newtInit(void);" ! " listItem: anInt1 top: anInt2 text: aString isDefault: anInt3 prevItem: cObject1 data: cObject2 flags: anInt4 newtComponent newtListitem(int left, int top, const char * text, int isDefault, newtComponent prevItem, const void * data, int flags); ! listItemSet: cObject text: aString void newtListitemSet(newtComponent co, const char * text); ! listItemGetData: cObject void * newtListitemGetData(newtComponent co); ! " label: anInt1 top: anInt2 text: aString "newtComponent newtLabel(int left, int top, const char * text);" ! labelSetText: anObject text: aString "void newtLabelSetText(newtComponent co, const char * text);" ! listBox: anInt1 top: anInt2 height: anInt3 flags: anInt4 "newtComponent newtListbox(int left, int top, int height, int flags);" ! listBoxAppendEntry: anObject1 text: aString data: anObject2 "int newtListboxAppendEntry(newtComponent co, const char * text, const void * data);" ! listBoxClear: anObject "void newtListboxClear(newtComponent co);" ! listBoxClearSelection: cObject "void newtListboxClearSelection(newtComponent co);" ! listBoxDeleteEntry: anObject1 data: anObject2 "int newtListboxDeleteEntry(newtComponent co, void * data);" ! listBoxGetCurrent: anObject "void * newtListboxGetCurrent(newtComponent co);" ! listBoxGetEntry: anObject1 num: anInt text: anObjectPtr1 data: anObjectPtr2 "void newtListboxGetEntry(newtComponent co, int num, char **text, void **data);" ! listBoxGetSelection: anObject1 numItems: anObject2 "void **newtListboxGetSelection(newtComponent co, int *numitems);" ! listBoxInsertEntry: anObject1 text: aString data: anObject2 key: anObject3 "int newtListboxInsertEntry(newtComponent co, const char * text, const void * data, void * key);" ! listBoxItemCount: anObject "int newtListboxItemCount(newtComponent co);" ! listBoxSelectItem: anObject1 key: anObject2 newFlagSense: anInt "void newtListboxSelectItem(newtComponent co, const void * key, enum newtFlagsSense sense);" ! listBoxSetCurrent: anObject num: anInt "void newtListboxSetCurrent(newtComponent co, int num);" ! listBoxSetCurrentByKey: anObject1 key: anObject2 "void newtListboxSetCurrentByKey(newtComponent co, void * key);" ! listBoxSetData: anObject1 num: anInt data: anObject2 "void newtListboxSetData(newtComponent co, int num, void * data);" ! listBoxSetEntry: anObject num: anInt text: aString "void newtListboxSetEntry(newtComponent co, int num, const char * text);" ! listBoxSetWidth: anObject width: anInt "void newtListboxSetWidth(newtComponent co, int width);" ! openWindow: aUint1 top: aUint2 width: aUint3 height: aUint4 title: aString "int newtOpenWindow(unsigned int left, unsigned int top, unsigned int width, unsigned int height, const char * title);" ! popHelpLine "void newtPopHelpLine(void);" ! popWindow "void newtPopWindow(void);" ! pushHelpLine: aString "void newtPushHelpLine(const char * text);" ! radiobutton: anInt1 top: anInt2 text: aString isDefault: anInt3 prevButton: anObject "newtComponent newtRadiobutton(int left, int top, const char * text, int isDefault, newtComponent prevButton);" ! radioGetCurrent: anObject "newtComponent newtRadioGetCurrent(newtComponent setMember);" ! redrawHelpLine "void newtRedrawHelpLine(void);" ! reFlowText: aString width: anInt1 flexDown: anInt2 flexUp: anInt3 actualWidth: anInt4 actualHeight: anInt5 "char * newtReflowText(char * text, int width, int flexDown, int flexUp, int * actualWidth, int * actualHeight);" ! refresh "void newtRefresh(void);" ! resizeScreen: anInt "void newtResizeScreen(int redraw);" ! resume "int newtResume(void);" ! runForm: anObject "newtComponent newtRunForm(newtComponent form);" ! scale: anInt1 top: anInt2 width: anInt3 fullValue: aLong "newtComponent newtScale(int left, int top, int width, long long fullValue);" ! scaleSet: anObject amount: aLong "void newtScaleSet(newtComponent co, unsigned long long amount);" ! scrollbarSet: anObject where: anInt1 total: anInt2 "void newtScrollbarSet(newtComponent co, int where, int total);" ! setColors: anObject "void newtSetColors(struct newtColors colors);" ! setHelpCallback: anObject "void newtSetHelpCallback(newtCallback cb);" ! setSuspendCallback: anObject1 data: anObject2 "void newtSetSuspendCallback(newtSuspendCallback cb, void * data);" ! textBox: anInt1 top: anInt2 width: anInt3 height: anInt4 flags: anInt5 "newtComponent newtTextbox(int left, int top, int width, int height, int flags);" ! textBoxGetNumLines: anObject "int newtTextboxGetNumLines(newtComponent co);" ! textBoxReflowed: anInt1 top: anInt2 text: aString width: anInt3 flexDown: anInt4 flexUp: anInt5 flags: anInt6 "newtComponent newtTextboxReflowed(int left, int top, char * text, int width, int flexDown, int flexUp, int flags);" ! textBoxSetHeight: anObject height: anInt "void newtTextboxSetHeight(newtComponent co, int height);" ! textBoxSetText: anObject text: aString "void newtTextboxSetText(newtComponent co, const char * text);" ! verticalScrollbar: anInt1 top: anInt2 height: anInt3 normalColorset: anInt4 thumbColorset: anInt5 "newtComponent newtVerticalScrollbar(int left, int top, int height, int normalColorset, int thumbColorset);" ! waitForKey "void newtWaitForKey(void);" ! winChoice: aString1 button1: aString2 button2: aString3 text: aString4 "int newtWinChoice(char * title, char * button1, char * button2, char * text, ...);" ! winChoice: aString1 button1: aString2 button2: aString3 text: aString4 args: aVariadic "int newtWinChoice(char * title, char * button1, char * button2, char * text, ...);" ! winEntries: aString1 text: aString2 suggestedWidth: anInt1 flexDown: anInt2 flexUp: anInt3 dataWidth: anInt4 items: anObject button1: aString3 "int newtWinEntries(char * title, char * text, int suggestedWidth, int flexDown, int flexUp, int dataWidth, struct newtWinEntry * items, char * button1, ...);" ! winEntries: aString1 text: aString2 suggestedWidth: anInt1 flexDown: anInt2 flexUp: anInt3 dataWidth: anInt4 items: anObject button1: aString3 args: aVariadic "int newtWinEntries(char * title, char * text, int suggestedWidth, int flexDown, int flexUp, int dataWidth, struct newtWinEntry * items, char * button1, ...);" ! winMenu: aString1 text: aString2 suggestedWidth: anInt1 flexDown: anInt2 flexUp: anInt3 maxListHeight: anInt4 items: anObjectPtr listItem: anObect button1: aString3 "int newtWinMenu(char * title, char * text, int suggestedWidth, int flexDown, int flexUp, int maxListHeight, char ** items, int * listItem, char * button1, ...);" ! winMenu: aString1 text: aString2 suggestedWidth: anInt1 flexDown: anInt2 flexUp: anInt3 maxListHeight: anInt4 items: anObjectPtr listItem: anObect button1: aString3 args: aVariadic "int newtWinMenu(char * title, char * text, int suggestedWidth, int flexDown, int flexUp, int maxListHeight, char ** items, int * listItem, char * button1, ...);" ! winMessage: aString1 buttonText: aString2 text: aString3 "void newtWinMessage(char * title, char * buttonText, char * text, ...);" ! winMessage: aString1 buttonText: aString2 text: aString3 args: aVariadic "void newtWinMessage(char * title, char * buttonText, char * text, ...);" ! winMessageEv: aString1 buttonText: aString2 text: aString3 args: aVariadic "void newtWinMessagev(char * title, char * buttonText, char * text, va_list argv);" ! winTernary: aString1 button1: aString2 button2: aString3 button3: aString4 message: aString5 "int newtWinTernary(char * title, char * button1, char * button2, char * button3, char * message, ...);" ! winTernary: aString1 button1: aString2 button2: aString3 button3: aString4 message: aString5 args: aVariadic "int newtWinTernary(char * title, char * button1, char * button2, char * button3, char * message, ...);" !! !Newt class methodsFor: 'examples'! demo self init; cls; drawRootText: 0 row: 0 text: 'Newt test program'; pushHelpLine: ''; drawRootText: -50 row: 0 text: 'More root text'; openWindow: 2 top: 2 width: 30 height: 10 title: 'first window'; openWindow: 10 top: 5 width: 65 height: 16 title: 'window 2'; bell; waitForKey; finished!!