Re: [tcltk-perl] Why is Tcl a subclass of Tck::Tk?
Brought to you by:
hobbs
From: Vadim K. <va...@ar...> - 2004-04-16 18:45:25
|
> > We are all in agreement - my perl fu is just not up to the > > task of doing this quickly. I was thinking that Tcl::Tk and > > Tcl::pTk should be separate modules, instead of the odd (to me) > > use Tcl::Tk q(:perlTk); > > that is there now. Actually 'use Tcl::Tk q(:perlTk);' needed only to export MainWindow, MainLoop functions and few other, and nothing more. Most perlTk syntax is available even without that qw(:perlTk) Currently you still can write using "perlTk syntax": use Tcl::Tk; $mw = Tcl::Tk::MainWindow; $mw->Button(-text=>'test',-command=>sub{print 'test'})->pack; Tcl::Tk::MainLoop; Probably things should be cleaned here as well... > > A separate module is cleaner. I would actually prefer that, but it is > certainly an API change. If we then end up with two ways of doing > this because we need to stay compatible I rather just keep as it is. In case we'll move out perlTk compatibility to separate module, what will stay in Tcl::Tk? Only few very old subroutines like "label", "toplevel" and so on? I think in case perlTk compatibility code will be big enough, we can arrange to have it in nearby file and load it only when needed. May be instead of doing special compatiiblity layer for perlTk, may be it could be reasonable to just use perlTk syntax as main way of doing GUI in perl? Many people just used to using that syntax from perl, and there are books about it. BTW (unrelated issue) if a line in Tk.pm "*{Tk::Exists} = \&Tcl::Tk::Exists;" is commented out, it is possible to debug Tcl::Tk code ising "ptkdb" debugger, which uses perlTk. Best regards, Vadim. |