Ce petit code que j'ai mis ici pour ne pas avoir à chercher la prochaine fois, résout 2 difficultés:
Voilà le code:
#!/usr/bin/python # -*- coding: utf-8 -*- from Tkinter import * class Edtexte(Frame): def __init__(self, master=None): Frame.__init__(self, master, width=600, height=480) self.grid(sticky=N+E+S+W) top=self.winfo_toplevel() top.rowconfigure(0, weight=1) top.columnconfigure(0, weight=1) self.rowconfigure(0, weight=1) self.columnconfigure(0, weight=1) self.edSBv = Scrollbar(self, orient=VERTICAL) self.edSBh = Scrollbar(self, orient=HORIZONTAL) self.edt = Text(self, wrap=NONE, yscrollcommand = self.edSBv.set, xscrollcommand = self.edSBh.set) self.edSBv.config(command=self.edt.yview) self.edSBh.config(command=self.edt.xview) self.edt.grid(row=0, column=0, sticky=N+E+S+W) self.edSBv.grid(row=0, column=1, sticky=N+S+E) self.edSBh.grid(row=1, column=0, sticky=S+E+W) fen = Tk() app = Edtexte(fen) fen.mainloop()