Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uunet!mcsun!ukc!acorn!ixi!clive From: clive@x.co.uk (Clive Feather) Newsgroups: comp.windows.x Subject: Re: Expose and ConfigureNotify events Message-ID: Date: 29 Nov 90 07:28:58 GMT References: <9011211352.AA11575@Larry.McRCIM.McGill.EDU> Reply-To: clive@x.co.uk (Clive D.W. Feather) Organization: IXI Limited, Cambridge, UK Lines: 28 In article <9011211352.AA11575@Larry.McRCIM.McGill.EDU> mouse@LARRY.MCRCIM.MCGILL.EDU writes: >> Question: I want an Expose event in all cases, i.e. whenever the >> window [Form widget] is resized, I want a guaranteed Expose event. >Yes. Set the window's bit-gravity to ForgetGravity. Since this is the >default, something somewhere along the line (Xt or the widget set, most >likely) is changing it. I suppose you could just bash the bit-gravity >of your window, but there's no guarantee that whatever changed it for >you in the first place won't helpfully change it back, so you should >get out the documentation and find out how to suppress this behavior. What is happening is that the Form widget does not define an expose method, and therefore (section 2.5.1 of the Xt manual) the bit_gravity is set to NorthWestGravity by the realize handler. Thus, this is being set by XtRealize, and it is safe to change it at any subsequent point. If I remember (the article seems to have expired here), the original questioner wanted to draw in the background of a Form widget. The *correct* way for her to do this is to define a subclass of Form. This would have all its methods NULL or XtInherit..., except for the expose method, which would carry out the actions she wants (perhaps calling a callback list). Because the expose method is not NULL, the bit_gravity will be left as ForgetGravity. This is much less work than you think. -- Clive D.W. Feather | IXI Limited | If you lie to the compiler, clive@x.co.uk | 62-74 Burleigh St. | it will get its revenge. Phone: +44 223 462 131 | Cambridge CB1 1OJ | - Henry Spencer (USA: 1 800 XDESK 57) | United Kingdom |