Hello, I have a problem in my application when using labels. The problem is that when writing a long text, the text continues and leaves the window. What I want is that the text does not pass from the area delimited by the window, and is put as a paragraph in several lines in the space that is available. I leave an example that simulates what I am telling in case I have not explained myself well.
import tkinter as tk
from tkinter import ttk
class Application(ttk.Frame):
def __init__(self, main_window):
super().__init__(main_window)
main_window.geometry("400x500")
self.text = tk.StringVar(value="Esto es un texto largo de ejemplo
para Stackoverflow. Esto es un texto largo de ejemplo para
Stackoverflow.")
self.label = tk.Label(self, text="text:").grid(column=0, row=0,
pady=10, padx=10, sticky="e")
self.label2 = tk.Label(self, text=self.text.get()).grid(column=1,
row=0, pady=20, sticky="w")
if __name__ == "__main__":
root = tk.Tk()
app = Application(root)
app.pack(expand=True, fill='both')
root.mainloop()