mirror of https://github.com/ksherlock/dict.git
cache TE Control Handle.
This commit is contained in:
parent
93491e673f
commit
74c012f2b7
17
nda.c
17
nda.c
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue