[comp.sys.mac.programmer] Modeless editText doesn't deactivate on suspend event

cc100aa@prism.gatech.EDU (Ray Spalding) (12/20/89)

I have written an application that has a modeless dialog window and is
multifinder friendly, i.e., has (in terms of MPW Rez):
	resource 'SIZE' (-1) {
		dontSaveScreen,
		acceptSuspendResumeEvents,
		disableOptionSwitch,
		canBackground,
		multiFinderAware,
		200 * 1024,
		140 * 1024
	};

The problem is that when I click in another application's window to
bring it to the front, the editText item in my modeless dialog window
doesn't get deactivated (that is, the selection remains highlighted or
the insertion point continues to blink).  (This problem doesn't occur
when switching between windows all belonging to this application itself).

It looks like DialogSelect is not multifinder friendly; shouldn't it
TEDeactivate the editText item when it gets a suspend event?

System is at level 6.0.4.
-- 
Ray Spalding, Office of Computing Services
Georgia Institute of Technology, Atlanta Georgia, 30332-0275
uucp:     ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!cc100aa
Internet: cc100aa@prism.gatech.edu

earleh@eleazar.dartmouth.edu (Earle R. Horton) (12/20/89)

In article <4448@hydra.gatech.EDU> cc100aa@prism.gatech.EDU
	(Ray Spalding) writes:
...
>It looks like DialogSelect is not multifinder friendly; shouldn't it
>TEDeactivate the editText item when it gets a suspend event?

One would think that this would be appropriate behavior.  DialogSelect
ignores suspend/resume events, however, and you have to handle them
yourself.  Probably the best approach is to change the event from an
app4Evt to an activateEvt, and set the modifiers, etc. so that DialogSelect
will do the right thing.  Note that this problem will also affect anything
else you may happend to have in a modeless dialog that needs to be
(de)activated when a suspend/resume event occurs.  Scroll bars come to
mind.

Earle R. Horton

6500stom@hub.UUCP (12/21/89)

> The problem is that when I click in another application's window to
> bring it to the front, the editText item in my modeless dialog window
> doesn't get deactivated (that is, the selection remains highlighted or
> the insertion point continues to blink).  (This problem doesn't occur
> when switching between windows all belonging to this application itself).

Remember that suspend and resume events need to be passed as activate
and deactivate events too. Just run them through your routines once
as suspend/resume and then again as activate/deactivate. Actually
the order should be deactivate-suspend then resume-activate.

/            Josh Pritikin             T Ignorance is bliss.           \
| Internet:  6500stom@ucsbuxa.ucsb.edu | I must be in hell.            |
| AppleLink: Josh.P                    | My room is proof that entropi |
\ GEnie:     J.Pritikin                ! exists.                       /