home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!news.umbc.edu!comb1.comb.umd.edu!stern
- From: stern@comb1.comb.umd.edu (Brian Stern; COMB)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: setwindowpic
- Date: 22 Jan 1993 11:33 EST
- Organization: University of Maryland, Center of Marine Biotechnology
- Lines: 52
- Distribution: world
- Message-ID: <22JAN199311331448@comb1.comb.umd.edu>
- References: <1993Jan21.145925.7504@neptune.inf.ethz.ch>
- NNTP-Posting-Host: comb1.comb.umd.edu
- News-Software: VAX/VMS VNEWS 1.41
-
- In article <1993Jan21.145925.7504@neptune.inf.ethz.ch>, rmaag@iiic.ethz.ch (Rolf Maag) writes...
- >Hi there...
- >
- >i have some questions about getwindowpic and setwindowpic.
- >
- >
- I use the following code in my initialization unit to put up a
- splash screen:
- var
- aPicHand: PicHandle;
- PicWind: WindowPtr;
- PicWinRect: Rect;
- TempBool: Boolean;
-
- {Read in the picture and display it}
- aPicHand := PicHandle(GetResource('PICT', 128));{Read in the picture}
- PicWind := NewWindow(nil, PicWinRect, '', True, altDBoxProc, WindowPtr(-1),False,0);
-
- SetWindowPic(PicWind, aPicHand);{Insert the picture into the window}
- TempBool := CheckUpdate(Event);{Make the win mgr draw the window pic}
-
- It normally isn't necessary to call CheckUpdate to draw a picture
- in a window but this example draws it immediately. A picture
- inserted into the windowPic field of a window record will be
- drawn the next time a call is made to WaitNextEvent. What actually
- happens is that if there are no other events in the event queue of
- a higher priority than an update event, WNE calls CheckUpdate.
- CheckUpdate then walks the window list from front to back looking
- for visible windows with non-null update regions. If it finds one
- that also has a picture associated with it, it draws the picture
- in the window. It then continues until it finds a window with a
- non-null update region and no picture. It then returns an update
- event for that window, which is processed by your program in
- the usual way. Note that you will never receive an update event
- for a window with a non-null windowPic field. If you insert a
- picture into a window with SetWindowPic and later change it and
- want it to be redrawn you can do an InvalRect
- (theWindow^.portrect). The picture will be redrawn the next time
- thru your event loop if no other events are pending. Update events
- have the lowest priority except for null events so mouse clicks,
- key presses will be processed first.
-
- Good Luck,
-
- Brian Stern
- Stern@mbimail.umd.edu
-
- __________________________________________________________________
- According to a software licensing notice:
- All trademarks are held by their respective owners.
- __________________________________________________________________
- >
-