cache TE Control Handle.

This commit is contained in:
Kelvin Sherlock 2019-07-08 18:18:16 -04:00
parent 93491e673f
commit 74c012f2b7
1 changed files with 6 additions and 11 deletions

17
nda.c
View File

@ -49,6 +49,8 @@ Word ipid;
Word FlagTCP; Word FlagTCP;
Word ToolsLoaded; Word ToolsLoaded;
GrafPortPtr MyWindow; GrafPortPtr MyWindow;
Handle TECtrlHandle;
Handle TextHandle; Handle TextHandle;
LongWord TextHandleSize; LongWord TextHandleSize;
@ -148,18 +150,10 @@ void AppendText2(word length, char *cp) {
} }
void SetText(void) { void SetText(void) {
Handle handle;
//TERecord *temp;
longword oldStart, oldEnd; longword oldStart, oldEnd;
handle = (Handle)GetCtlHandleFromID(MyWindow, rCtrlTE); TESetSelection((Pointer)-1, (Pointer)-1, TECtrlHandle);
//temp = *(TERecord **)handle; TESetText(teDataIsTextBox2|teTextIsPtr, (Ref)*TextHandle, TextHandleUsed, NULL, NULL, TECtrlHandle);
//temp->textFlags &= (~fReadOnly);
TESetSelection((Pointer)-1, (Pointer)-1, handle);
TESetText(teDataIsTextBox2|teTextIsPtr, (Ref)*TextHandle, TextHandleUsed, NULL, NULL, handle);
//temp->textFlags |= fReadOnly;
TextHandleUsed = 0; TextHandleUsed = 0;
@ -439,6 +433,7 @@ void NDAClose(void) {
CloseWindow(MyWindow); CloseWindow(MyWindow);
MyWindow = NULL; MyWindow = NULL;
TECtrlHandle = NULL;
NDAResourceShutDown(&resInfo); NDAResourceShutDown(&resInfo);
@ -491,7 +486,7 @@ GrafPortPtr NDAOpen(void) {
ShowWindow(MyWindow); ShowWindow(MyWindow);
SelectWindow(MyWindow); SelectWindow(MyWindow);
TECtrlHandle = (Handle)GetCtlHandleFromID(MyWindow, rCtrlTE);
ConnectionInit(&connection, MyID, MarinettiCallback); ConnectionInit(&connection, MyID, MarinettiCallback);