Hacker News new | ask | show | jobs
by acchow 484 days ago
Because Tk draws using native OS APIs. So you’d need to run the whole OS in the browser.

Or you could implement a new backend for Tk to draw using some web APIs

2 comments

Or he could use replit which did go to the trouble of implementing a web backend for the tk wm.

There's also a gtk backend for tk (gtkttk), as convoluted as that sounds, so presumably you could use gtk web implementations (broadway) behind that...

In any case, Tk doesn't require an OS to do window drawing, it's entirely up to how things are hooked up.

It’s been awhile, but if you have a browser old enough, here the browser plug-in for TCL/TK: https://www.tcl-lang.org/software/plugin/
That doesn't render a web interface, it just bundles the platform specific executable so you can run scripts embedded in the web browser. Kinda like a hole in the web page into which an exe is shoved.

Also, no browser runs that stuff anymore, and it wouldn'tve been safe to run even when they did.