🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: locking focus

#1954
From: Ray Spalding
Date: Wed, 23 Dec 1992 17:40
22 lines
1346 bytes
In article <1992Dec23.162156.1556@netcom.com> vin@netcom.com (Vin Locke) writes:
>I have a another method that draws to the view that I want to call from 
>a menu, also a pswrap-ped function.  However, when I execute this from the
>menu, the graphics are drawn in the menu itself!  yuck-o!  

You could have the method that is the target of your menu item do a
[self display], assuming the method is in your View and that your
View does the right thing in drawSelf::.  ("display" takes care of
focusing for you.)

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];
	}
-- 
Ray Spalding, Office of Information Technology
Georgia Institute of Technology, Atlanta Georgia, 30332-0715
Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
Technical Details
Message-ID: <78766@hydra.gatech.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!gatech!prism!xray.gatech.edu!cc100aa
References: <1992Dec23.162156.1556@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!gatech!prism!xray.gatech.edu!cc100aa
From: cc100aa@xray.gatech.edu (Ray Spalding)
Newsgroups: comp.sys.next.programmer
Subject: Re: locking focus
Keywords: view, lockfocus, pswrap
Message-ID: <78766@hydra.gatech.EDU>
Date: 23 Dec 92 17:40:40 GMT
References: <1992Dec23.162156.1556@netcom.com>
Sender: news@prism.gatech.EDU
Organization: Georgia Institute of Technology
Lines: 22