Platzieren eines Labels und einer TextBox im NordwestenPython

Python-Programme
Anonymous
 Platzieren eines Labels und einer TextBox im Nordwesten

Post by Anonymous »

Wie ich wollte, dass das Ergebnis aussieht: Ich möchte ein Label und eine TextBox in der nordwestlichen Ecke neben meinem Frame platzieren, der sich in der nordöstlichen Ecke befindet.
UI-Screenshot
Ich habe versucht, ein Label und ein TextBox in der oberen nordwestlichen Ecke neben meinem Frame zu platzieren, der sich in der oberen nordöstlichen Ecke befindet.

Code: Select all

from tkinter import *
from tkinter import filedialog
import os

root = Tk()
root.title()
root.iconbitmap()
root.geometry("400x400")
root["bg"] = "Cyan"

LabelXP1 = Label(bg='Cyan',
width=10,
height=1,
text=f"XPATH 1:")
LabelXP1.pack(anchor= NW)
xpath1 = Text(root,width= 20, height= 1)
xpath1.pack(anchor= NW)

LabelXP2 = Label(bg='Cyan',
width=10,
height=1,
text=f"XPATH 2:")
LabelXP2.pack(anchor= NW)
xpath2 = Text(root,width= 20, height= 1)
xpath2.pack(anchor= NW)

list_frame = Frame(root, background="Cyan")
list_frame.pack(anchor= NE)
Label1 = Label(list_frame, background='Cyan',
width=6,
height=1,
text="Urls: 0")
Label1.pack(anchor= N)

scrollbar = Scrollbar(list_frame, orient=VERTICAL)
scrollbarh = Scrollbar(list_frame, orient=HORIZONTAL)

listbox = Listbox(list_frame, background="Cyan", width=20,     yscrollcommand=scrollbar.set, xscrollcommand=scrollbar.set)
scrollbar.config(command=listbox.yview)
scrollbar.pack(side=RIGHT, fill=Y)

scrollbarh.config(command=listbox.xview)
scrollbarh.pack(side=BOTTOM, fill=X)

listbox.pack(pady=20)

root.mainloop()

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post