Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to retrieve the interpreter from a Tk_Window?

11 views
Skip to first unread message

Georgios Petasis

unread,
Mar 30, 2006, 5:13:28 AM3/30/06
to
Hi all,

I have register a ClientMessageHandler for a Tk_Window, with
Tk_CreateClientMessageHandler. My event gets handled,
and my callback function gets called. But how can I get the
Tcl_Interp that this Tk_Window has been created in?
(It seems that Tk keeps this information internally, in the
TkWindow structure. But how can I get this information from
an extension?)

George


Pat Thoyts

unread,
Mar 31, 2006, 4:48:48 PM3/31/06
to
"Georgios Petasis" <pet...@iit.demokritos.gr> writes:

For tkvideo it seems I just included an interp pointer in the widget
structure and set it when the widget gets created :(

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD

Georgios Petasis

unread,
Mar 31, 2006, 6:31:53 PM3/31/06
to
Which cannot be done in my case, unfortunatelly.
I have registered a ClientMessageHandler, which gets activated
in already created windows. When the event callback gets called,
I only get a Tk_Window pointer. There is "no" way I can get
the interp.

But, if I include the Tk internal headers, and convert the Tk_Window
into a TkWindow pointer, I can get it with:

TkWindow *winPtr = (TkWindow *) tkwin;
if (winPtr->mainPtr != NULL) interp = winPtr->mainPtr->interp;

It is a pitty since Tk keeps this information, to not have a function
like Tk_GetInterp(Tk_Window *) in the public API.


George

"Pat Thoyts" <cngg...@hfref.fbheprsbetr.arg> wrote in message
news:87ek0iq...@users.sourceforge.net...

0 new messages