c++ class-method & Tcl_CreateCommand 
Author Message
 c++ class-method & Tcl_CreateCommand

  Peter Schartner <pschartn>,
  In a message on 2 Mar 1996 12:58:19 GMT, wrote :

PS> Is there a way to use a class-method as the function-parameter of
PS> Tcl_CreateCommand ? At the time I use a workaround. I create the command with a
PS> normal c-function and this c-function calls the method of the object.

It is never possible to use a normal class method as a passed function (to be
called back later).  You *can* use a *static" class method, but you still have
to pass the instance pointer as the client data and call a normal class method
from the static method.  This is true not only for Tcl_CreateCommand(), but
for Motif, Xaw, or Xt callback routines too.  The simplest hack is to put the
Tcl_CreateCommand() calls in a Xxx_Init() function, use some static c functions
to call the proper member methods.  I do this in both the Tcl/Tk interfaces for
my Home Librarian and Role Playing Database packages.  The source is available
for both on ftp://sunsite.unc.edu/pub/Linux and mirrors.  Visit my virtual
storefront for details (second url in my .sig).


http://www.*-*-*.com/ ~heller  ||FidoNet:    1:321/153
http://www.*-*-*.com/ ;/\

Thu, 20 Aug 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. c++ class-method & Tcl_CreateCommand

2. Definining C++ class methods in external .ASM (OBJ) files

3. Tcl_CreateCommand and C++

4. Q: Again: Tcl_CreateCommand() and MS Visual C++

5. Help: Tcl_CreateCommand() and MS Visual C++

6. Classes & Methods

7. Soundformat class & method

8. methods & 1st class messages

9. accessing a instance method from a class method

10. How do I call a method from another method within the same class

11. Class methods vs Instance methods

12. Class method vs instance method???


Powered by phpBB® Forum Software