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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |