【发布时间】:2021-12-18 06:37:39
【问题描述】:
我使用 image(image1) 作为背景,并使用 create_window 方法创建了条目。 我想让 image(image2) 用 create_image 方法覆盖条目。 但是每次都会显示 Entry 小部件。(Entry - image2 - imgae1) 如何更改这些的顺序,例如 image2-Entry-image1。 我的代码如下。
self.img_main = PhotoImage(file=r"C:\Bart\My library\Python\Grinding\GUI\capture\image1.png")
self.canvas_main = Canvas(self, width=1366, height=768, bd=0)
self.canvas_main.pack(fill=BOTH, expand=True)
self.canvas_main.create_image(0,0, image=self.img_main, anchor=NW)
self.entry = Entry(self, width=12, justify="center", bg="#A5C1DE")
self.canvas_main.create_window(72, 287, height=32, anchor=NW, window=self.entry)
self.cbb_pro_sel_img_1 = PhotoImage(file=r"C:\Bart\My library\Python\Grinding\GUI\capture\image2.png")
self.cbb_pro_sel = self.canvas_main.create_image(36, 75, anchor=NW, image=self.cbb_pro_sel_img_1)
【问题讨论】:
标签: python tkinter tkinter-canvas tkinter-entry