home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!rutgers!cmcl2!acf5!checker
- From: checker@acf5.NYU.EDU (checker)
- Newsgroups: comp.lang.c++
- Subject: Re: Callbacks - C++ needs an extension?
- Message-ID: <1896@acf5.NYU.EDU>
- Date: 2 Sep 92 05:09:49 GMT
- References: <1992Aug28.165108.17479@isy.liu.se> <1992Aug29.161356.16729@genghis.borland.com> <1893@acf5.NYU.EDU> <DAVIDM.92Aug31105639@consilium.com>
- Distribution: comp
- Organization: New York University
- Lines: 31
-
- davidm@consilium.com (David S. Masterson) writes:
- >Interesting technique, but I have a few questions:
-
- >1. Could you make this work in the case of windowing systems that treat
- >callbacks as C functions? Would it be a double callback (ie. callback to a C
- >function that then calls the appropriate callback object)?
-
- I'm working on this one. I have an idea (in the formative stages) for a
- way to bind the necessary object and its member function together into a
- C style function using templates, but I'm going to wait until it is
- better developed before I post it.
-
- >2. How does the windowing system pass data to the callback? With buttons,
- >for instance, all that needs to be known is the action (buttonPush). With
- >text widgets, though, the program will want to get at the data that is
- >provided in the event.
-
- See my latest post for the way to send data to the function. Basically,
- you use templates to specify the types you want the callback function to
- take; it's easy.
-
- >3. Given a windowing system based on C, its likely that the information
- >coming from the windowing system will not be C++ object oriented (ie. it won't
- >follow a C++ inheritance model). How do you convert?
-
- This is a big problem. The first step is to get as far away from the C
- interface level as you can. There are plenty of C++ abstractions for
- almost any C based windowing system. I haven't seen any that are
- entirely satisfactory, but it is a young market, and that will change.
-
- Chris
-