WebFeb 4, 2024 · 设置 Scrollbar 组件的 command 选项为该组件的 yview () 方法。 from tkinter import * root = Tk() sb = Scrollbar(root) sb.pack(side=RIGHT,fill=Y) lb = Listbox(root,yscrollcommand=sb.set) for i in range(1000): lb.insert(END,i) lb.pack(side = LEFT,fill=BOTH) sb.config(command=lb.yview) mainloop() 1 2 3 4 5 6 7 8 9 10 11 12 13 … Web1 day ago · root = tk.Tk () root.wm_title ("TPCE - WareViz") root.geometry ("1000x600") # create the main frame to hold everything main_frame = tk.Frame (root) main_frame.pack (fill="both", expand=True) # create a top frame for the buttons, text and so on top_frame = tk.Canvas (main_frame) top_frame.pack (side="top", fill="x") # # Create a canvas widget …
Python Tkinter Scrollbar - python tutorials
WebAug 23, 2024 · Tkinter scrollbar widget is not a part of any other widgets such as Text and Listbox. Instead, a scrollbar is an independent widget. To use the scrollbar widget, you … WebMay 28, 2024 · scrollbar Widgetの作成には、 tk.Scrollbar () を使用します。 「text Widgetの作成」で紹介したコード内の text = tk.Text (frame, height=4) の下へ以下のコードを貼り付けてください。 1 # 2. scrollbar Widgetの作成 2 # frame Widget (Frame)を親要素として、scrollbar Widgetを作成する。 3 # 第一引数 : 親Widget 4 # 第二引数以降 (任意) : option 5 … bob dylan once upon a time chords
python tkinter 滚动条 - CSDN文库
A scrollbar allows you to view all parts of another widget whose content is typically larger than the available space. Tkinter scrollbar widget is not a part of any other widgets such as Text and Listbox. Instead, a scrollbar is an independent widget. To use the scrollbar widget, you need to: 1. First, create a scrollbar … See more The Text widgets are one of several types of scrollable widgets. The following program illustrates a simple user interface that consists of Text and … See more Web有誰知道為什么 Tkinter 上的 xscrollbar 運行這么慢? 下面是一個簡單的測試用例: import tkinter as tk content = '' for x in range(40): content += str(x)*7000 + '\n' window = tk.Tk() text = tk.Text(wrap = tk.NONE) text.insert(tk.INSERT, content) text.pack() scrollbar = tk.Scrollbar(window, orient = 'horizontal') scrollbar.config(command = text.xview) … WebDec 4, 2024 · CTkScrollbar ( app, command=tk_textbox. yview ) ctk_textbox_scrollbar. grid ( row=0, column=1, sticky="ns" ) # connect textbox scroll event to CTk scrollbar tk_textbox. … bob dylan once upon a time youtube