home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / next / programm / 7898 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  1.3 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!gatech!prism!xray.gatech.edu!cc100aa
  2. From: cc100aa@xray.gatech.edu (Ray Spalding)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: locking focus
  5. Keywords: view, lockfocus, pswrap
  6. Message-ID: <78766@hydra.gatech.EDU>
  7. Date: 23 Dec 92 17:40:40 GMT
  8. References: <1992Dec23.162156.1556@netcom.com>
  9. Sender: news@prism.gatech.EDU
  10. Organization: Georgia Institute of Technology
  11. Lines: 22
  12.  
  13. In article <1992Dec23.162156.1556@netcom.com> vin@netcom.com (Vin Locke) writes:
  14. >I have a another method that draws to the view that I want to call from 
  15. >a menu, also a pswrap-ped function.  However, when I execute this from the
  16. >menu, the graphics are drawn in the menu itself!  yuck-o!  
  17.  
  18. You could have the method that is the target of your menu item do a
  19. [self display], assuming the method is in your View and that your
  20. View does the right thing in drawSelf::.  ("display" takes care of
  21. focusing for you.)
  22.  
  23. Or, you could do something like the following:
  24.     BOOL isfv = [self isFocusView];
  25.     if (!isfv) [self lockFocus];
  26.     // drawing code goes here
  27.     if (!isfv) {
  28.         [self unlockFocus];
  29.         [[self window] flushWindow];
  30.     }
  31. -- 
  32. Ray Spalding, Office of Information Technology
  33. Georgia Institute of Technology, Atlanta Georgia, 30332-0715
  34. Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
  35.