Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!rusux1!asterix.luftfahrt.uni-stuttgart.de!treinies From: treinies@asterix.luftfahrt.uni-stuttgart.de (Klaus-Achim Treinies) Newsgroups: comp.sys.mac.programmer Subject: WindowObject in Object Pascal Message-ID: <311@rusux1.rus.uni-stuttgart.de> Date: 5 Nov 90 09:49:28 GMT Sender: zrf80385@rusux1.rus.uni-stuttgart.de Reply-To: treinies@asterix.luftfahrt.uni-stuttgart.de (Klaus-Achim Treinies) Organization: Dept. for Statics & Dynamics of Aerospace Structures (ISD) Lines: 75 I'm just starting OOP with Object Pascal under MPW. The first object I'm working on is a window object defined as TWindow = object(TObject) fRecord : WindowRecord; fVScroll : ControlHandle; fHScroll : ControlHandle; procedure Install; ... procedure Something; ... end; procedure TWindow.Install; var aWindowPtr : WindowPtr; begin ... aWindowPtr := GetNewWindow(..., @self.fRecord, ...); ... ShowWindow(aWindowPtr); ... end; Installing the window works nice when calling procedure WindowOpen; var aWindowObject : TWindow; begin New(aWindowObject); aWindowObject.Install; ... end; Now the problem: How do I get a link between aWindowPtr and aWindowObject in a procedure which deals with events like grow, update etc. What I want to do in particular is something like procedure DoSomething(theEvent : EventRecord); var aWindowPtr : WindowPtr; aWindowObject : TWindow; what : integer; begin what := FindWindow(theEvent.where, aWindowPtr); { here I want the link } { aWindowPtr ----> aWindowObject; } { so I can go on with } case what of ... something : aWindowObject.Something; ... end; end; For all the answers I hope to receive I want to say THANK YOU VERY MUCH! -- ============================================================================ ACHIM TREINIES | treinies@asterix.luftfahrt.rus.uni-stuttgart.de ISD, UNI. STUTTGART | PFAFFENWALDRING 27 | D-7000 STUTTGART 80 | GERMANY | ============================================================================