PYTHON / TKINTER:如何使2个标签相互堆叠

时间:2018-10-12 08:53:58

标签: python user-interface tkinter

import tkinter as tk

class Header(tk.Frame):

    def __init__(self, master):

        master.title("Header")

        frame = tk.Frame(master, bg='green')
        frame.pack(fill=tk.X, ipadx=20)

        heading = tk.Label(frame, text = 'Heading', bg="green")
        heading.pack(side=tk.LEFT, anchor=tk.N)

        line1_header = tk.Label(frame, text='Paragraph', bg='green')
        line1_header.pack(side=tk.LEFT, anchor=tk.N)

root=tk.Tk()
app = Header(root)
root.mainloop()

如何在tkinter中将这两个标签相互堆叠?当前正在发生的是彼此相邻。

预先感谢:)

0 个答案:

没有答案