static PyObject *TEObj_TEIdle(TEObject *_self, PyObject *_args) { PyObject *_res = NULL; #ifndef TEIdle PyMac_PRECHECK(TEIdle); #endif if (!PyArg_ParseTuple(_args, "")) return NULL; TEIdle(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; }
/* idle procedure for TextEdit */ short NATEidlep(na_win *winp) { TEIdle(teinfo->hTE); return (NA_PROCESSED); }
void RunLoop() { EventRecord theEvent; WindowPtr whichWindow; Rect txRect; txRect = qd.thePort->portRect; InsetRect(&txRect,4,0); textH = TENew(&txRect,&txRect); while (!quit) { SystemTask(); TEIdle(textH); if (GetNextEvent(everyEvent, &theEvent)) { switch (theEvent.what) { case mouseDown: { switch (FindWindow(theEvent.where, &whichWindow)) { case inSysWindow: { SystemClick(&theEvent, whichWindow); break; } case inMenuBar: { DoCommand(MenuSelect(theEvent.where)); break; } case inDrag: { DragWindow(whichWindow, theEvent.where, &qd.screenBits.bounds); break; } case inContent: { if (whichWindow != FrontWindow()) { SelectWindow(whichWindow); } else { GlobalToLocal(&theEvent.where); if (theEvent.modifiers&shiftKey) isShift = true; TEClick(theEvent.where, isShift, textH); } break; } case inGoAway: { if (TrackGoAway(whichWindow, theEvent.where)) { quit = true; } break; } default: break; } break; } case autoKey: case keyDown: { char theChar = (theEvent.message&charCodeMask); if (theEvent.modifiers&cmdKey) { DoCommand(MenuKey(theChar)); if (theChar == 'm') { quit = true; } } else { TEKey(theChar, textH); } break; } case activateEvt: { if (theEvent.modifiers&activeFlag) { TEActivate(textH); } else { TEDeactivate(textH); } break; } case updateEvt: { BeginUpdate((WindowPtr)theEvent.message); EraseRect(&(qd.thePort->portRect)); TEUpdate(&(qd.thePort->portRect), textH); EndUpdate((WindowPtr)theEvent.message); break; } default: break; } } } }