home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 21955 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.6 KB

  1. Path: sparky!uunet!haven.umd.edu!news.umbc.edu!comb1.comb.umd.edu!stern
  2. From: stern@comb1.comb.umd.edu (Brian Stern; COMB)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: setwindowpic
  5. Date: 22 Jan 1993 11:33 EST
  6. Organization: University of Maryland, Center of Marine Biotechnology
  7. Lines: 52
  8. Distribution: world
  9. Message-ID: <22JAN199311331448@comb1.comb.umd.edu>
  10. References: <1993Jan21.145925.7504@neptune.inf.ethz.ch>
  11. NNTP-Posting-Host: comb1.comb.umd.edu
  12. News-Software: VAX/VMS VNEWS 1.41    
  13.  
  14. In article <1993Jan21.145925.7504@neptune.inf.ethz.ch>, rmaag@iiic.ethz.ch (Rolf Maag) writes...
  15. >Hi there...
  16. >i have some questions about getwindowpic and setwindowpic.
  17. >
  18. I use the following code in my initialization unit to put up a
  19. splash screen:
  20. var
  21.   aPicHand: PicHandle;
  22.   PicWind: WindowPtr;
  23.   PicWinRect: Rect;
  24.   TempBool: Boolean;
  25.  
  26. {Read in the picture and display it}
  27.   aPicHand := PicHandle(GetResource('PICT', 128));{Read in the picture}
  28.   PicWind := NewWindow(nil, PicWinRect, '', True, altDBoxProc, WindowPtr(-1),False,0);
  29.  
  30.  SetWindowPic(PicWind, aPicHand);{Insert the picture into the window}
  31.   TempBool := CheckUpdate(Event);{Make the win mgr draw the window pic}
  32.  
  33. It normally isn't necessary to call CheckUpdate to draw a picture
  34. in a window but this example draws it immediately. A picture
  35. inserted into the windowPic field of a window record will be
  36. drawn the next time a call is made to WaitNextEvent. What actually
  37. happens is that if there are no other events in the event queue of
  38. a higher priority than an update event, WNE calls CheckUpdate.
  39. CheckUpdate then walks the window list from front to back looking
  40. for visible windows with non-null update regions. If it finds one
  41. that also has a picture associated with it, it draws the picture
  42. in the window. It then continues until it finds a window with a
  43. non-null update region and no picture. It then returns an update
  44. event for that window, which is processed by your program in
  45. the usual way. Note that you will never receive an update event
  46. for a window with a non-null windowPic field. If you insert a
  47. picture into a window with SetWindowPic and later change it and
  48. want it to be redrawn you can do an InvalRect
  49. (theWindow^.portrect). The picture will be redrawn the next time
  50. thru your event loop if no other events are pending. Update events
  51. have the lowest priority except for null events so mouse clicks,
  52. key presses will be processed first.
  53.  
  54. Good Luck,
  55.  
  56. Brian Stern
  57. Stern@mbimail.umd.edu
  58.  
  59. __________________________________________________________________
  60. According to a software licensing notice:
  61. All trademarks are held by their respective owners.
  62. __________________________________________________________________
  63.