🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2009

Re: locking focus

#2009
From: Ali Ozer
Date: Sat, 02 Jan 1993 20:25
16 lines
929 bytes
In article <78766@hydra.gatech.EDU> Ray Spalding writes:
>Or, you could do something like the following:
>	BOOL isfv = [self isFocusView];
>	if (!isfv) [self lockFocus];
>	// drawing code goes here
>	if (!isfv) {
>		[self unlockFocus];
>		[[self window] flushWindow];
>	}

It's more efficient to do the flushWindow before you unlockFocus;
otherwise flushWindow has to temporarily focus on the window containing 
the view. Of course there isn't a noticable hit unless you are doing this
in a time critical situation.

Ali, Ali_Ozer@NeXT.com
Technical Details
Message-ID: <6140@rosie.NeXT.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!aozer
References: <1992Dec23.162156.1556@netcom.com> <78766@hydra.gatech.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!aozer
From: aozer@next.com (Ali Ozer)
Newsgroups: comp.sys.next.programmer
Subject: Re: locking focus
Keywords: lockfocus, flushWindow
Message-ID: <6140@rosie.NeXT.COM>
Date: 2 Jan 93 20:25:57 GMT
References: <1992Dec23.162156.1556@netcom.com> <78766@hydra.gatech.EDU>
Sender: news@NeXT.COM
Organization: Next Computer, Inc.
Lines: 18