Re: Tk Wrapper?

new topic     » goto parent     » topic index » view thread      » older message » newer message
Icy_Viking said...

So I was recently looking into Tcl/Tk and I thought about making a wrapper using the Tk library. However upon further reading it appears that Tcl and tk are pretty intertwined with each other.

It seems you're correct about the two being intertwined. Tk is basically an instance of Tcl and the C API is just running Tcl commands into the interpreter.

Icy_Viking said...

However I know wrappers of tk exist for other languages, so it must be feasible for Euphoria, maybe.

Looking at the tkinter module for Python, you can see how they initialize a new Tkapp here:

https://github.com/python/cpython/blob/master/Modules/_tkinter.c#L693

Basically, you have to spin up a Tcl interpreter via Tcl_CreateInterp() and use that to create an application with Tcl_AppInit().

Icy_Viking said...

Though the C-API documentation is a little lacking in my opinion.

It's very lacking. Reminds of old Cisco documentation that just tells you what something is, and not why it is or how to use it. Dry, boring, and effectively useless.

What's really weird though, is that I can't seem to any tutorials online for the Tcl or Tk C APIs. Not even so much as a "Hello world!" app. Plenty of stuff for native Tcl or Python though.

Icy_Viking said...

It looks like there was an old Tcl/Tk wrapper. However looking at the archives, the project dates back to 2008, so that would be pretty old. I took a look at the old wrapper and it looks like it didn't make a whole of progress, but could be a good place to start.

I haven't looked at the existing wrapper, but Tcl and Tk don't seem to have changed a whole lot in the past... ever. So it may just need some tweaks to accommodate 64-bit memory access, etc.

I installed tcl8.6-dev and tk8.6-dev on my machine and had a look at the provided include files under /usr/include/tcl8.6.

It seems that everything is pretty straight-forward for a C API, no weird structs-by-value and what not.

The only problem is that the Tcl library is well over 500 functions! But I guess then we you could also utilize embedded Tcl scripts if you needed?

Icy_Viking said...

Just wanting to hear thoughts if it would be worth it or too many hoops to jump through to get it working properly.

I'll reiterate what Chris said: I'm sure someone might find it useful but nobody seems to be asking for it either. I think our efforts are best directed elsewhere.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu