🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #6999

Another TransSkel patch (not a bug fix)

#6999
From: Paul DuBois
Date: Fri, 29 Aug 1986 22:06
43 lines
1753 bytes
Here's a patch to TransSkel that will allow you to take advantage
of the printf window posted to mod.mac recently.  It will also allow
modeless dialogs to be handled in TransSkel applications, something
that was not possible before.  The basic idea is to provide a way
for the host to inspect event records before TransSkel handles them.

Add the following lines somewhere:

static Boolean (*pEvent)() = nil;

SkelEventHook (p)
Boolean	(*p)();
{
	pEvent = p;
}

and in SkelMain, change:

	DoEvent (&theEvent);

to:

	if (pEvent == nil || (*pEvent) (&theEvent) == false)
		DoEvent (&theEvent);


The hook should be declared as follows:

Boolean EventHook (evtPtr)
EventRecord	*evtPtr;

If a hook is installed, any time it returns true, TransSkel will
assume it handled the event and will ignore it.  If the hook returns
false, TransSkel handles the event as usual.

Pass nil to SkelEventHook to de-install event inspection.
-- 
Paul DuBois     UUCP: {allegra,ihnp4,seismo}!uwvax!uwmacc!dubois    |
                ARPA: dubois@easter                               --+--
                                                                    |
Begin at my sanctuary...                                            |
                          Ezekiel 9:6
Technical Details
Message-ID: <224@uwmacc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!uwvax!uwmacc!dubois

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!uwvax!uwmacc!dubois
From: dubois@uwmacc.UUCP (Paul DuBois)
Newsgroups: net.micro.mac
Subject: Another TransSkel patch (not a bug fix)
Message-ID: <224@uwmacc.UUCP>
Date: Fri, 29-Aug-86 18:06:01 EDT
Article-I.D.: uwmacc.224
Posted: Fri Aug 29 18:06:01 1986
Date-Received: Fri, 29-Aug-86 21:43:50 EDT
Distribution: net
Organization: UW-Madison Primate Center
Lines: 43