Resize Tkinter Scrolling Text Box

I would like to make a scrollable Tkinter text field that fills the maximum allocated space. I have a working view ...

For some reason, when I stretch the window, the text widget is beautiful; However, the scrollbar gets a ton of indentation along the x axis.

The second problem is when I squeeze the window, the scroll bar comes out of the screen.

Does anyone know the solutions to these two programs?

snippet:

    self.Fr = Tkinter.Frame(self, width=self.Wi, height=self.He)
    self.Fr.pack(side='right', fill='both', expand='yes')


    self.Te = Tkinter.Text(self.Fr, font=self.Fo, fg=self.FG, bg=self.BG,
                           selectforeground=self.SFG,
                           selectbackground=self.SBG,
                           insertbackground=self.IBG, wrap='word',
                           undo=True, maxundo=100)
    #self.Te.grid(column=0, row=0, sticky='NSEW')
    self.Te.pack(side='left', fill='both', expand='yes')


    self.Sc = Tkinter.Scrollbar(self.Fr, elementborderwidth=1)
    #self.Sc.grid(column=1, row=0, sticky='NSEW')
    self.Sc.pack(side='right', fill='both', expand='yes')

    self.Te.configure(yscrollcommand=self.Sc.set)
    self.Sc.configure(command=self.Te.yview)
+1
source share
1 answer

, fill='both'. , , x, , , . , Y- , X.

, , , .

: , pack, , , , . , , , . , , .

"", , - . , , . , , Tk , . , , .

, , , .

, , , , , , expand true. "" . , , "" , .

, . , , . , , , . , , ( ), . , ( ) .

, , .

+6

All Articles