ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcltk-perl
tcltk-perl
RE: [tcltk-perl] Code for Tcl mainloop routines
by Vadim Konovalov other posts by this author
May 20 2005 9:21AM messages near this date
Re: [tcltk-perl] Code for Tcl mainloop routines | [tcltk-perl] Code for Tcl mainloop routines
>  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.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Tcltk-perl mailing list
Tcltk-perl@[...].net
https://lists.sourceforge.net/lists/listinfo/tcltk-perl

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved