Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!bloom-beacon!RIACS.EDU!davy From: davy@RIACS.EDU Newsgroups: comp.windows.x Subject: Re: background pixmap in a widget Message-ID: <8812121641.AA05830@intrepid.riacs.edu> Date: 12 Dec 88 16:41:25 GMT References: <8812092154.AA03487@LYRE.MIT.EDU> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 35 From: Ralph R. Swick Date: Fri, 09 Dec 88 16:54:48 EST Subject: Re: background pixmap in a widget > Anyway, I'd like to have my widget come up with a custom background > pixmap made from some bitmap data I have. ... > Should I make my own RealizeProc? Yes, the realize procedure is the appropriate place to put one-time resource creation of this type. The initialize procedure could be used as well and it's almost a toss-up, but delaying until realize allows for the possibility that a client may change some resource data (via XtSetValues, for example) upon which your created resources depend. Section 2.5 of 'X Toolkit Intrinsics - C Language Interface' is the place to read about realize procedures. Thanks -- works like a charm. I made the mistake of looking at XtRealizeWidget instead of WindowObjRealize the first time, and was a little daunted by how complex I thought the realize proc was, hence using the exposure proc. But now that I looked in the right place, it's amazing how simple this all is. I do have a suggestion for the next rev of the Xt docs... in the sections which talk about all the different procs (realize, expose, initialize, etc.) it might be useful to include what the defaults do with some explan- atory notes. That way someone who needs to write their own would have something to go by other than digging through the code. Overall though, I like the widgets... especially since R3 came with a menu (List) widget - I wasn't looking forward to doing that on my own. --Dave