0
  1. I am adding a frame label with tkinter so I can put some text labels in it. And I want to know how to make that frame adjust it self with the text. Text starts at the top and goes downwards ,but when the last text gets to the bottom it disappears like every text after that one. I want to know how can I make that frame "scroll" itself like move itself down with the text.

  2. Similar thing to the first question, but this time I want to know how can I make the text that is in the frame stop going of the screen on the right side. How can I make it so when it gets to the edge of that frame to continue the text in the next line?

from tkinter import *

def main():
    root = Tk()

    def click():
        lab1 = Label(newFrameLabel, text="Something")
        lab1.pack()

    newFrameLabel = LabelFrame(root, width=50, height=100)
    newFrameLabel.pack_propagate(flag=False)
    newFrameLabel.pack(anchor=NW)

    newButton = Button(root, text="Submit", command=click)
    newButton.pack(anchor=NW)

    root.mainloop()

main()

So when I press the "submit" button a couple of times the text piles up, and when it gets to the bottom of the screen I think it creates the next text label bellow the last text, but outside of the frame where its not visible.

Ryaagard
  • 13
  • 2
  • 1
    Perhaps you can share a simple, executable example of code that replicates this behaviour. Then someone can help you fix it. – scotty3785 Jan 29 '20 at 15:47
  • 1
    The tkinter "Text" widget supports automatic line wrapping and can have scroll bars connected to it. – scotty3785 Jan 29 '20 at 15:49
  • Can you put a sample of what you tried? – DaniyalAhmadSE Jan 29 '20 at 15:58
  • ***"Text goes out of the Frame"***: Can't reproduce this, please make sure, code you posts actually behaves as you claim. Read [Adding a scrollbar to a group of widgets in Tkinter](https://stackoverflow.com/a/3092341/7414759) – stovfl Jan 29 '20 at 21:18

0 Answers0