Re: TCL Plugin 3.0 main window question (C code)



On 27 nov, 22:45, Jeff Hobbs <je...@xxxxxxxxxxxxxxx> wrote:
opaq...@xxxxxxxxxxxxx wrote:
I've created a new widget type. Everything works as expected in a
Win32 app embedding a TCL intepreter.
I would like to use it with the 3.0 TCL plugin (by loading my .dll)

This C code don't work:

parentW = Tk_MainWindow(interp);
myTkW = Tk_CreateWindowFromPath( interp, parentW, path, NULL);

because Tk_MainWindow(interp) returns NULL in the plugin context.

How can i get a valid TK_Window to use it as a parent window for new
widgets ?

Exactly how is this integrated with the plugin? If you create an
extension for this widget, make sure it has a Foo_SafeInit function, and
it should be able to load (plugin permissions set right) and work.

Jeff

Hello and thank you.

My DLL extension loads into the plugin (i configured the security
policy to gain access to the load function). The DLL has been
qualified in a Win32 App embedding an intepreter.

I run a script the plugin, my extension loads, initialization code is
called and new C commands are created. Everything is ok so far. When
the script tries to instantiate new widgets, it fails because
Tk_MainWindow returns NULL.

I took a look at some other C widgets (tkButton.c) and found calls to
Tk_MainWindow(interp) and well, it works in the plugin (i can create a
button !) I read some posts in the past about Tk_MainWindow(interp)
returning NULL in the plugin context but i can't figure the problem
in plugin 3.0.

I suspect that the topmost widget . is NOT a toplevel in the plugin.
How can i get a Tk_Window descriptor for widget . in order to invoke
Tk_CreateWindowFromPath ?

By the way, are there better (safer ?) ways than loading an external
DLL in order to extend the plugin with C Code ?

Thanks a lot.



.


Quantcast