home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / next / programm / 7964 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  903 b 

  1. Path: sparky!uunet!rosie!aozer
  2. From: aozer@next.com (Ali Ozer)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: locking focus
  5. Keywords: lockfocus, flushWindow
  6. Message-ID: <6140@rosie.NeXT.COM>
  7. Date: 2 Jan 93 20:25:57 GMT
  8. References: <1992Dec23.162156.1556@netcom.com> <78766@hydra.gatech.EDU>
  9. Sender: news@NeXT.COM
  10. Organization: Next Computer, Inc.
  11. Lines: 18
  12.  
  13. In article <78766@hydra.gatech.EDU> Ray Spalding writes:
  14. >Or, you could do something like the following:
  15. >    BOOL isfv = [self isFocusView];
  16. >    if (!isfv) [self lockFocus];
  17. >    // drawing code goes here
  18. >    if (!isfv) {
  19. >        [self unlockFocus];
  20. >        [[self window] flushWindow];
  21. >    }
  22.  
  23. It's more efficient to do the flushWindow before you unlockFocus;
  24. otherwise flushWindow has to temporarily focus on the window containing 
  25. the view. Of course there isn't a noticable hit unless you are doing this
  26. in a time critical situation.
  27.  
  28. Ali, Ali_Ozer@NeXT.com
  29.  
  30.  
  31.