Very sorry if I caused any trouble, maybe I missed to specify "outdated from a Tk, especially macOS-related, perspective".
We work on an app using Tk on macOS, and Perl/Tk is - in our terms - outdated. It runs with 'hacks' (needs XQuartz) and the UI it produces is non-Acqua compatible, looks like old-fashioned UI and this makes Perl/Tk, in our modest opinion, a no-go in the macOS world (okay, you can define it not as outdated, happy to learn another definition that better suits this group). Tcl::pTk gives instead access to the modern Tcl/Tk framework which is actively maintained and in line with UI conventions and styles on macOS. No more than this.
My question is pretty straightforward: from a portion of code written diretcly in Tcl inside $int->Eval("...") we want to call a subrutine which lives in the normal Perl code. A typical case would be to manipulate macOS typical menu entries such as Preferences, that can not be done - as far as we know directly from Perl i.e. Tcl::pTk:
my $int = $mw->interp; my $menuPATH = $int->widget($menubar);#getting Tk name $int->Eval(" $menuPATH add cascade -menu [menu $menuPATH.apple] proc tk::mac::ShowPreferences {} {#CALL SUBRUTINE IN PERL +CODE THAT CREATES THE COMPLEX MENU WINDOW TO SET APP PREFERENCES"} ");
Does it make more sense now
PS: Python standard UI framework is Tkinter which uses the same principle of Tcl::pTk, i.e. it links to the original Tcl/Tk framework.
Thank you
In reply to Re: call a sub from Tcl code in Tcl::pTk
by Anonymous Monk
in thread call a sub from Tcl code in Tcl::pTk
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |