in reply to Re^6: Tk Drag and Drop Between Applications
in thread Tk Drag and Drop Between Applications

looks like I built Tcl.xs w/out Tcl stubs and it found tcl85.lib at that time. sorry
Please try a bit different tcl.dll - from http://www.vkonovalov.ru/unicode/84/Tcl.dll

BTW for my own application I tend to built entire tcl/tk into one large single dll, and will share that on the web afterwards...

  • Comment on Re^7: Tk Drag and Drop Between Applications

Replies are listed 'Best First'.
Re^8: Tk Drag and Drop Between Applications
by Ardemus (Beadle) on Dec 16, 2004 at 22:52 UTC
    Thanks for the second dll. Unfortunately, it looks like it was from 0.81 (a prior build):
    C:\DOCUME~1\nburger\Desktop\PERL&T~1\Tcl-Tk-0.84\tk-demos>perl widget Tcl object version 0.81 does not match bootstrap parameter 0.84 at c:/ +Perl/lib/DynaLoader.pm line 253. Compilation failed in require at c:/Perl/site/lib/Tcl/Tk.pm line 4. BEGIN failed--compilation aborted at c:/Perl/site/lib/Tcl/Tk.pm line 4 +. Compilation failed in require at widget line 5. BEGIN failed--compilation aborted at widget line 5.
      Indeed.

      Sorry for inconvenience, (I switched to another box and it was tricky to check at that time)

      You can download it again from http://vkonovalov.ru/unicode/84-0.84/

      However 0.81 is what I currently use on my PC so if you'll just temporarily change version in Tcl.pm to 0.81 all should be good: 0.84 was immediately after 0.81 and probably there were only smal changes there

      Best regards,
      Courage, the Cowardly Dog

        Courage, Thank you so very much for your help so far!
        After a sanity break, I got my app up in Tcl::Tk in Perl/Tk compatability mode. I've been reading demos, docs, and articles. This is the Tcl/Tk code that I think I need to run (followed by my questions):
        package require tkdnd dnd bindsource .perl_hlist_object text/uri {\&Perl_Sub} bind .perl_hlist_object <1> {dnd drag %W}

        1) Do I need the interp object to setup DnD?

        I can start a Tcl::Tk GUI in one of two ways:
        my $mw = MainWindow->new; #Gives me the main window object, but not + the interpreter my $interp = new Tcl::Tk; #Gives me the interpreter, but not the ma +in window

        Do I need both objects? I think I need the interp object to make DnD calls, and the main window object to use perl/Tk compatability mode syntax. Is there a way to get both objects? Should I rewrite the GUI in Tcl/Tk syntax?

        2) Can I get a Tcl/Tk path from a perl widget object?

        This is related to #1. I can get object for a Tcl/Tk path with: my $hlist = widget(".f03.hlist01"); However, I have the ojbect and I think I need the path to set up DnD.

        3) How do I make the actual calls?

        Here's my stab at the Tcl/Tk objects under Tcl::Tk in perl (I haven't tested this because of #1):

        My $i = new Tcl::Tk; (... generate GUI ...) $i -> call("package require", "tkdnd"); $i -> call("dnd bindsource", ".perl_hlist_object", "text/uri", {\&Perl +_Sub}); $i -> call("bind", ".perl_hlist_object", "<1>", {dnd drag %W};
        Is this correct, are there any gotchas?

        1. Can I put a use a perl object instead of a Tcl/Tk path (i.e. $results_l instead of .f03.hlist01)?
        2. Is the script on line 4 expecting a Tcl sub, or can I call a perl sub? Is there a special syntax?
        3. I don't understand the reference to %W. It's "The window the event is delivered to", and it doesn't make sense to me in this context. Would I leave it %W, or do I need to provide a value?
        I greatly appreciate any help in this. It feels like I'm close, but I don't know where to look for the 'last mile'.