简体   繁体   English

TKinter 中带有多个小部件的滚动条

[英]Scrollbar in TKinter with multiple widgets

So for a couple of days I worked on a little project to make a to do list app for my raspberry pi with a database and an http server.所以有几天我在一个小项目上工作,为我的树莓派制作一个带有数据库和 http 服务器的待办事项列表应用程序。 I figured out almost everything but I'm stuck on making a scrollbar for all the multiple labels + delete buttons that it creates.我想出了几乎所有的东西,但我坚持为它创建的所有多个标签+删除按钮制作滚动条。 I know my code is REALLY messy but I'm working on it.我知道我的代码真的很乱,但我正在努力。 Any help on the scroll bar is appreciated.对滚动条的任何帮助表示赞赏。 Here is the full code:这是完整的代码:

Link to code because it was too much Code slightly edited 链接到代码,因为它太多了代码略有编辑

This won't exactly answer your question, but this is something I learned and I think it might be useful.这不会完全回答你的问题,但这是我学到的东西,我认为它可能有用。

Tkinter is not super easy for larger projects and it is a pain to get the UI to set how you want.对于大型项目来说,Tkinter 并不是很容易,而且让 UI 设置你想要的方式是很痛苦的。 I personally am TERRIBLE with UI and always spent hours doing very minor tweaks.我个人对 UI 很不满意,总是花几个小时做很小的调整。 I personally Love Qt designer (it is free and it even comes with Anaconda).我个人喜欢 Qt 设计器(它是免费的,甚至随 Anaconda 一起提供)。 I use it for all of my UIs now.我现在将它用于我所有的用户界面。 It is a graphical way to build your UI and is much more initiative and powerful.它是一种构建 UI 的图形方式,并且更加主动和强大。

With Qt it will create scroll bars in just a few clicks and you can customize all the aspects of it.使用 Qt 只需点击几下即可创建滚动条,您可以自定义它的所有方面。

I was building a project and spent WEEKS with Tkinter, I build the same app, only better in about one day.我正在构建一个项目并在 Tkinter 上度过了几周,我构建了相同的应用程序,仅在大约一天之内变得更好。 It is worth starting over.值得重新开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM