Still working on a problem that I can't figure out even after some useful input so I thought I would try and dumb it down. I have an example that I'm using in Tcl and a perl script using Tcl::Tk for the mainwindow. I'd like to be able to mix the two so I have all widgets in one main window but I can't figure out how to do it. My issue seems to be that the Tcl window is using Eval and I therefore can't use it to call the Tcl::Tk widgets as that code is not recognized by Tcl. I can define another mainwindow and have two windows but that's not what I want. Here is my code

use Tcl::Tk; my $int = new Tcl::Tk; $int->Eval(<<'EOS'); package require tkdnd catch {console show} pack [ttk::button .drop_target -text " Drop Target (I can accept anyth +ing!) "] \ -fill x -padx 20 -pady 20 pack [ttk::button .drop_target2 -text " Drop Target (I can accep +t anything!) "] \ -fill x -padx 200 -pady 200 tkdnd::drop_target register .drop_target DND_Files bind .drop_target <<Drop>> {puts "Generic data drop: \"%D\"! +!"; return %A} bind .drop_target <<Drop:DND_Text>> {puts "Dropped text: \"%D\""; re +turn %A} bind .drop_target <<Drop:DND_Files>> {puts "Dropped files: \"[join %D +{, }]\""; return %A} bind .drop_target <<Drop:DND_Files>> {file copy %D "cities.txt"} destroy .win1 EOS my $move_button3 = $int->Button( -text => "Run", -command => \&CallScript); $move_button3->grid( -row => 5, -column => $runcolumn, -columnspan => +1 ); MainLoop;

Thanks in advance for any help you can provide. I just can't see how to get this working


In reply to Tcl & Tcl::Tk used for 1 main window by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.