我想在我的主要Tkinter窗口中嵌入一个终端.我想有一个子窗口,其中一个终端(基于
Bash的终端)将运行.我也希望能让我的程序与终端进行交互,至少我想阅读当前的工作目录和/或设置它.
我不知道这是不是真的不可能.我过去能用Perl / Tk做到这一点,所以也许它可以在这里复制.
我之后使用的代码类似于:
$frame3=$mw->Frame(-borderwidth=>2, -relief=>'groove', # -label=>'stuff for thought',
-labelBackground=>CADRAWWINCOLOR,-background=>CADRAWWINCOLOR);
$cv=$frame3->Canvas(-height=>$cvheight,-width=>$cvwidth,-background=>CADRAWWINCOLOR,
-bg => CADRAWWINCOLOR,
-relief => 'sunken')->pack(-expand => 1, -fill => 'both');
# this Frame is needed for including the xterm in Tk::Canvas
my $xtermContainer = $cv->Frame(-container => 1);
my $xtid = $xtermContainer->id();
# converting the id from HEX to decimal as xterm requires a decimal Id