RE: [tcltk-perl] Code for Tcl mainloop routines
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2005-05-20 16:13:24
|
> Consequently, after talking with Vadim, I added a few > routines to Tcl.xs, with > the corresponding documentation in Tcl.pm and a test named > t/mainloop.t. The > routines provided are DoOneEvent, CreateChannelHandler, > DeleteChannelHandler, > MakeFileHandler, CreateTimerHandler and DeleteTimerHandler. > > From that point, I have a proposal and a question: > > - the proposal: IntuiLab is willing to share that code under > the same license > terms as perl-Tcl. I have prepared a patch based on Tcl-0.87 > that I can send > upon request. Please do so. > > - the question: our next step was to integrate perl-Tk with > that mainloop > (yes, I know. But our code relies on perl-Tk and we can't > change that easily). > And we discovered that perl-Tk and Tcl *cannot* be used at > the same time: they > implement functions with the same name that do different > things. Consequently, Please provide more details here. Probably you mean that you cound not link both perl/Tk and Tcl/tk into one single binary file (either DLL or exe or somesuch) Otherwise all is possible: Perl is able to contain both Tk and Tcl::Tk, and they even could run together in one application. Following lines are toy and nothing usefull, but application starts and even works (buttons give their responces, and all is good until it gets not good :):) use strict; use Tk; use Tcl::Tk; if (fork) { tkinit->Button(-text=>'text',-command=>sub { print STDERR "he-he, perl/Tk\n"; })->pack->MainLoop; } else { Tcl::Tk::tkinit->Button(-text=>'text2',-command=>sub { print STDERR "he-he, Tcl::Tk\n"; })->pack->interp->MainLoop; } Also, two different loops are here; however "right" coexistence should rely on one single MainLoop' > we have had to build our own versions of Tcl and perl-Tcl > with all identifiers > changed :-( Any suggestion for a better solution? We are > willing to share the > bridge code (implemented as a Tcl notifier), but in the > present circumstances > it is pretty useless to anyone outside us. Of course your efforts on adding perl/Tk compatibility to Tcl::Tk would be very appreciated. Please share your ideas, . I, for one, not spending many efforts on improving perl/Tk compatibility right now, because I realized that I can move entirely into Tcl::Tk module. Best regards, Vadim. |