Home > Archive > Tcl > July 2004 > [SWIG]TargetLanguageCallbacks
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[SWIG]TargetLanguageCallbacks
|
|
| Christoph Hörterer 2004-07-05, 3:58 pm |
| Hi,
I found this in the SWIG Wiki:
http://www.signal6.com/cgi-bin/wiki...nguageCallbacks
Now, I don't know how to adapt this to Tcl. Can anyone help me with this?
My problem, is also addressed on another wiki page, within the very
first question, but the answer wasn't very useful to me.
http://www.signal6.com/cgi-bin/wiki.pl?SwigFaqCallbacks
My situation: I have a Tcl(Main)programm which loads a dll. Within this
dll one function evokes a callback. This callback should be written in
Tcl. But this is not possible with SWIG by default. Perhaps, somebody
could help me.
I would be glad for any advice.
Thanks, Christoph
| |
| Ashok P. Nadkarni 2004-07-06, 3:57 am |
| You might try asking on the SWIG mailing list
http://mailman.cs.uchicago.edu/mailman/listinfo/swig
/Ashok
Christoph Hörterer <news@pofi.de> wrote in message news:<2kth16F4uul0U1@uni-berlin.de>...
> Hi,
> I found this in the SWIG Wiki:
> http://www.signal6.com/cgi-bin/wiki...nguageCallbacks
>
> Now, I don't know how to adapt this to Tcl. Can anyone help me with this?
> My problem, is also addressed on another wiki page, within the very
> first question, but the answer wasn't very useful to me.
> http://www.signal6.com/cgi-bin/wiki.pl?SwigFaqCallbacks
>
> My situation: I have a Tcl(Main)programm which loads a dll. Within this
> dll one function evokes a callback. This callback should be written in
> Tcl. But this is not possible with SWIG by default. Perhaps, somebody
> could help me.
> I would be glad for any advice.
>
> Thanks, Christoph
| |
| Christoph Hörterer 2004-07-06, 3:57 am |
| I tried, but my postings didn't appear.
Ashok P. Nadkarni wrote:
[color=darkred]
> You might try asking on the SWIG mailing list
> http://mailman.cs.uchicago.edu/mailman/listinfo/swig
>
> /Ashok
>
> Christoph Hörterer <news@pofi.de> wrote in message news:<2kth16F4uul0U1@uni-berlin.de>...
>
| |
| Bob Techentin 2004-07-12, 4:05 pm |
| "Christoph Hörterer" <news@pofi.de> wrote
> My situation: I have a Tcl(Main)programm which loads a dll. Within
> this dll one function evokes a callback. This callback should be
> written in Tcl. But this is not possible with SWIG by
> default. Perhaps, somebody could help me. I would be glad for any
> advice.
>
> Thanks, Christoph
You could save "interp" in a static variable in the %init% section of
your SWIG file. Then just have a function that calls
Tcl_Eval(interp,"callback");
Bob
--
Bob Techentin techentin.robert@NOSPAMmayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/
| |
| Christoph Hörterer 2004-07-23, 8:57 am |
| Bob Techentin schrieb:
> "Christoph Hörterer" <news@pofi.de> wrote
>
>
>
> You could save "interp" in a static variable in the %init% section of
> your SWIG file. Then just have a function that calls
> Tcl_Eval(interp,"callback");
>
> Bob
Hi,
How should this look like?
Something like that:
> %init %{
>
> static Tcl_Interp* interp;
>
> %}
I know this is not right, because I'm getting this error message,
when compiling:
> error: identifier "interp" is undefined
I would be glad if you could help me with this.
Christoph
| |
| Bob Techentin 2004-07-28, 9:08 pm |
| "Christoph Hörterer" <chh@mmk.ei.tum.de> wrote[color=darkred]
> Bob Techentin schrieb:
of[color=darkred]
>
> How should this look like?
> Something like that:
>
> I know this is not right, because I'm getting this error message,
> when compiling:
The variable "interp" is already defined in the function that includes
your %init code. So you want to declare a static variable with a
different name, something like
%init %{
static Tcl_Interp* myInterp;
myInterp = interp ;
%}
But the %init code is inside a function, so you may need a combination
of global and static to make it work properly with your callbacks.
Bob
--
Bob Techentin techentin.robert@NOSPAMmayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/
|
|
|
|
|