eserte / perl-tk

the perl module Tk
https://metacpan.org/release/Tk
Other
44 stars 31 forks source link

Support native GUI on OS X #24

Open mojca opened 8 years ago

mojca commented 8 years ago

The Tkx module supports the native GUI on OS X, but there haven't been any commits since 2010 and I'm not sure if the development of that module is still alive.

Since Tk itself works natively on OS X, I don't understand why the Perl module needs X11. Is there any easy way to fix this? Or does the whole code depend on existence of X11?

codebykevin commented 7 years ago

The Tkx module still works fine. It is not a drop-in replacement for Perl Tk, but porting code over shouldn't be terribly difficult. As it is a thin wrapper over Tk, and Tk itself doesn't evolve a lot, it is not going to see a lot of development.

eserte commented 7 years ago

@codebykevin: Looking at http://matrix.cpantesters.org/?dist=Tkx%201.09;reports=1#sl=7,1 it does not look like the Tkx module works for everybody. Especially there was no pass report from CPAN Testers for more than a year. And some platforms never had a pass report, e.g. FreeBSD.

@mojca: maybe it's doable, the Tk core for Perl/Tk is roughly the same as for Tcl/Tk, but probably it's not "easy".

mojca commented 7 years ago

One test fails for me on OS X.

codebykevin commented 7 years ago

Regardless of whether it passes its test suite, the module works fine for me and provides a modern Tk GUI from Perl, unlike Perl-Tk. I have it deployed in a production release of a cross-platform app that runs on Mac and Windows: https://www.codebykevin.com/filemorph.html, https://fossil.codebykevin.com/fossil.cgi/filemorph/timeline, https://www.codebykevin.com/filemorph-main.png, https://www.codebykevin.com/fm-main-windows.png

chrstphrchvz commented 6 years ago

I'm curious if anyone else here has already tried Tcl::pTk::TkHijack. One effect it has is letting existing Perl/Tk programs run on macOS without XQuartz. I'm not sure how refined it is yet, though; for the program I've been trying it on, if certain idioms were used (e.g. classical menubars turning into pull-down lists) or assumptions made about the UI (e.g. label sizes), they might look strange with native UI (see before and after).