Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!decwrl!asente From: asente@decwrl.dec.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: A Call for Callforwards... Message-ID: <1537@bacchus.dec.com> Date: 30 Jun 89 04:40:05 GMT References: <8906291555.AA02112@LYRE.MIT.EDU> <8906292347.AA04479@bu-cs.BU.EDU> Organization: DEC Western Software Lab Lines: 29 In article <8906292347.AA04479@bu-cs.BU.EDU> bzs@BU-CS.BU.EDU (Barry Shein) writes: > >Ok, two votes for just use "call_data" (Paul Asente also suggested >this.) > >What about the semantics of multiple callbacks supported by >CallCallbacks, does this gibe with passing data back? How is it >coordinated so the call_data isn't stomped on multiple times (ok, the >programmer should just be careful etc, but there is a little bit of >gee why do anything since the user can always write code to simulate >it eventually?) I would suggest passing in the call_data the address of a data structure something like struct { Boolean data_supplied; }; The widget would set data_supplied to FALSE before executing the callbacks. Each callback checks data_supplied before filling in the rest of the data and sets data_supplied to TRUE once the data is there. This allows having multiple callbacks, each of which might have the information needed to fill in the data at different times during program execution. This organization could well lead to more modular programs. -paul asente asente@decwrl.dec.com decwrl!asente