Webb9 aug. 2024 · I have this situation where I need to make the scrolledText as readonly, so the user can only add values to it through a button, like the following: from tkinter import * from tkinter import Webb31 juli 2024 · sc r = scrolledtext.ScrolledText (window, width =70, height =13 ,font = ( "隶书", 18 )) #滚动文本框(宽,高(这里的高应该是以行数为单位),字体样式) sc r.place (x =50, y =50) #滚动文本框在页面的位置 i = "你太优秀了,没有错题! " de f panduan (): i ="你太优秀了,没有错题! " if score == 100: scr.insert ( END ,i) else: for b in list 2: #遍历错 …
python3 tkinter.scrolledtext.ScrolledText添加数据后滑动到指定位置
Webb29 maj 2024 · from tkinter import * from tkinter. scrolledtext import ScrolledText window = Tk window. geometry ('970x45') box = ScrolledText (window, width = 70, height = 7). … Webb5 jan. 2024 · scrolledtext插入和删除数据 from tkinter import Tk from tkinter import scrolledtext from tkinter import END # 記得引入 END root = Tk() st = … trip affiliate
How to clear/delete the contents of a Tkinter "ScrolledText" widget?
WebbHow it works. First, import the tkinter module and the ScrolledText class from the tkinter.scrolledtext module.; Second, create the root window and set its title to 'ScrolledText Widget'.; Third, create a new ScrolledText widget and display it on the root window.; Finally, start the main loop. Here’s the same program but written using the … Webb5 juni 2024 · tkiner组件之滚动文本框(scrolledtext )相关操作 1.创建一个滚动文本框import tkinter as tkfrom tkinter import scrolledtext root = … WebbScrolledText ttkbootstrap.scrolled.ScrolledText ( Frame ) A text widget with optional vertical and horizontal scrollbars. Setting autohide=True will cause the scrollbars to hide when the mouse is not over the widget. The vertical scrollbar is on by default, but can be turned off. The horizontal scrollbar can be enabled by setting vbar=True. trip aided and complex phase steels