Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!ANDREW.CMU.EDU!tpn+ From: tpn+@ANDREW.CMU.EDU (Tom Neuendorffer) Newsgroups: comp.soft-sys.andrew Subject: Re: bug in proctable? Message-ID: Date: 4 Jan 91 22:37:20 GMT References: <8bVCy_y00VsWIBlYxO@andrew.cmu.edu> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 49 Excerpts from mail: 4-Jan-91 Re: bug in proctable? Dave Gross@rchland.iinus (654+0) > I seems that proctable wasn't designed to call other objects in the > current view tree, just the current object and any inherited class > procs. Is that right? Right, proctable knows nothing about the view tree. Gary's post demonstrates one way dealing with this problem. However Excerpts from mail: 4-Jan-91 Re: bug in proctable? Gary Keim (1345+0) > I don't know if there is an official way to call the function associated > with a given proctableEntry. Anyway, that should do it. Gary's deleteWindow procedure would be better written as follows. This takes advantage of the fact that frame's delete window procedure checks if the current window is the last one. It also will not become obsolete if we change what delete-window does is some future patch. This illustrates the 'proper' way to call a proctable entry. boolean getMyFrame( frame, im ) struct frame *frame; long im; { if(frame_GetIM(frame) == ((struct im *) im)) return(TRUE); else return(FALSE); } void deleteWindow( self, ignore ) struct myview *self; long ignore; { struct im *im = myview_GetIM(self); struct frame *myframe = NULL; struct proctable_Entry *pr; int (*proc)(); if(im && ((myframe = frame_Enumerate(getMyFrame,(long)im)) != NULL) && (pr = proctable_Lookup("frame-delete-window")) != NULL && proctable_Defined(pr)) { proc = proctable_GetFunction(pr) ; (*proc)(myframe,0); } } Tom