1
나는 지금 Tkinter를 배우고있다. 그때 명백한 방법으로이 코드를 변경하려고 할 때, 그러나 enter image description hereTkinter에서 가로 스크롤 막대를 얻는 방법은 무엇입니까?
다음 좋은 출력을 생성
from tkinter import * # Import tkinter
class ScrollText:
def __init__(self):
window = Tk() # Create a window
window.title("Scroll Text Demo") # Set title
frame1 = Frame(window)
frame1.pack()
scrollbar = Scrollbar(frame1)
scrollbar.pack(side = RIGHT, fill = Y)
text = Text(frame1, width = 40, height = 10, wrap = WORD,
yscrollcommand = scrollbar.set)
text.pack()
scrollbar.config(command = text.yview)
window.mainloop() # Create an event loop
ScrollText() # Create GUI
: 내 책에서, 나는 간단한 세로 스크롤 막대를 생성하기위한 다음과 같은 코드를 얻을 가로 스크롤바를 얻으려면 이상한 결과가 나옵니다. 여기에 내가이 프로그램을 실행할 때 내가 여기
from tkinter import * # Import tkinter
class ScrollText:
def __init__(self):
window = Tk() # Create a window
window.title("Scroll Text Demo") # Set title
frame1 = Frame(window)
frame1.pack()
scrollbar = Scrollbar(frame1)
scrollbar.pack(side = BOTTOM, fill = X)
text = Text(frame1, width = 40, height = 10, wrap = WORD,
xscrollcommand = scrollbar.set)
text.pack()
scrollbar.config(command = text.xview)
window.mainloop() # Create an event loop
ScrollText() # Create GUI
를 사용하고있어 코드는 내가 무엇을 얻을 것입니다 : 당신은 수직 scrollbar
에 수평 스크롤, xscrollcommand
을 할당하고 enter image description here
:와
. 그건 그렇습니다. TY. –
@ Will.Im.Not 문제 없습니다. – Nae