Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 第二个文本编辑器小部件在框架tkinter中不可见_Python_User Interface_Tkinter_Ide - Fatal编程技术网

Python 第二个文本编辑器小部件在框架tkinter中不可见

Python 第二个文本编辑器小部件在框架tkinter中不可见,python,user-interface,tkinter,ide,Python,User Interface,Tkinter,Ide,我正在使用Tkinter为项目制作IDE。我试图在一个框架中添加两个文本小部件,当我尝试这样做时,只会看到一个文本编辑器。我也尝试过在框架内使用.grid(),但它弄乱了布局,仍然没有显示出来 以下是我的代码(如果有帮助): my_frame = Frame(window) my_frame.pack(pady=5, fill = X) #Scrollbar for the text editor text_scroll = Scrollbar(my_frame) text_scroll.p

我正在使用Tkinter为项目制作IDE。我试图在一个框架中添加两个文本小部件,当我尝试这样做时,只会看到一个文本编辑器。我也尝试过在框架内使用.grid(),但它弄乱了布局,仍然没有显示出来

以下是我的代码(如果有帮助):

my_frame = Frame(window)
my_frame.pack(pady=5, fill = X)


#Scrollbar for the text editor
text_scroll = Scrollbar(my_frame)
text_scroll.pack(side = RIGHT, fill =Y)

# Horizontal Scrollbar

hor_scroll = Scrollbar(my_frame, orient = 'horizontal')
hor_scroll.pack(side = BOTTOM, fill = X)

#Text Widget (Text Editor)
text = Text(my_frame, width = 100, height = 200, font = ("Helvetica",10),selectbackground = "black", selectforeground = "white", undo = True, yscrollcommand = text_scroll.set, wrap = "none",xscrollcommand = hor_scroll.set)
text.pack(side = TOP)

#Text Widget (Status Console)
console = Text(my_frame, width = 100, height = 200, font = ("Helvetica",10),selectbackground = "black", selectforeground = "white", undo = True, yscrollcommand = text_scroll.set, wrap = "none",xscrollcommand = hor_scroll.set)
console.pack(side = BOTTOM)

谢谢,, Dhruv Gupta

height=200
(表示200行,而不是像素)使
文本
小部件非常高,因此第二个
文本
放在可视区域之外。尝试较小的
高度值