[ Bug] set_vscroll_position on multiline broken in version 4.61.0.206

未关闭
#6,626 26 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
desktop

调研方向

从 PySimpleGUI.py 中 set_vscroll_position 的实现开始,检查它在 tkinter 端口上如何与 multiline 元素和 cprint 交互。使用一个最小程序重现报告的滚动行为,并比较 4.60.5 和 4.61.0.206 版本。完成的标准是 multiline 输出能够正确滚动,而不需要 window.refresh(),也不会导致闪烁。

由索引模型根据 Issue 内容生成。

描述

Bug Port - TK
Type of Issue (Enhancement, Error, Bug, Question)

Bug


Operating System

Windows 10

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
port: tkinter
tkinter version: 8.6.13
PySimpleGUI version: 4.60.5
PySimpleGUI filename: C:\Users\Simon\AppData\Roaming\Python\Python312\site-packages\PySimpleGUI\PySimpleGUI.py


Your Experience In Months or Years (optional)

Years Python programming experience - 1 year

Years Programming experience overall - 40 plus years (doesn't mean I'm any good though)

Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine) - No

Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • [X ] Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • [X ] None of your GUI code was generated by an AI algorithm like GPT
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • [ X] Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • [X ] Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description

Looks like a bug, but it might just be the way I am using it.

Using cprint to print to multiline element. Using set_vscroll_position when output has more lines than multiline can show.

Worked beautifully in pysimplegui 4.60.5

Upgraded to pysimplegui 4.61.0.206 to take advantage of something... can't remember what it was. Some days later realised that
my cprint to multiline does not scroll / scrolls by a tiny amount in pysimplegui 4.61.0.206. It can be made to work with an additional call to window.refresh(), but this makes the multiline flash in a most unattractive manner.

Reverted to version 4.60.5 and it works beautifully again. No window.refresh required and no flashing.

Code To Duplicate

A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)

This pre-formatted code block is all set for you to paste in your bit of code:


# Paste your code here
# It will take some effort to create a short program to isolate the issue. If you are not already aware of this I will try to produce something.

Screenshot, Sketch, or Drawing

Watcha Makin?

A program to replay chess games from my games database. I use cprint to get the current move highlighted in red in the multiline.
screenshot

主要语言
Python
星标
13.8k
派生
1.8k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PySimpleGUI/PySimpleGUI 的其他 Issue

查看 PySimpleGUI/PySimpleGUI 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。