【发布时间】:2023-02-05 06:13:18
【问题描述】:
所以我在一台笔记本电脑上写了一个程序,但现在我买了一台新笔记本电脑,想在我的新笔记本电脑上运行相同的代码,它看起来很不一样。我正在使用一个名为 customtkinter 的框架来制作 GUI。两台笔记本电脑上的 Python 和 Ubuntu 版本相同,所有内容都已更新和升级。我的新笔记本电脑的分辨率为 3000x2000,而我的旧笔记本电脑的分辨率为 1920x1080,但即使我在脚本中增加尺寸,情况也不会如此,这不会起作用。我使用的库版本与我的旧笔记本电脑上的版本相同。请帮忙!
import tkinter
from tkinter import ttk
import customtkinter
from customtkinter import *
import datetime as dt
from datetime import datetime
customtkinter.set_appearance_mode("Dark")
customtkinter.set_default_color_theme("dark-blue")
class App(customtkinter.CTk):
def __init__(self):
# Window config
root = CTk()
root.title("Kassa System")
root.geometry(f"{1920}x{1080}")
root.resizable(False,False)
root.mainloop()
if __name__ == "__main__":
app = App()
app.mainloop()
enter image description here The old one, this is what it should look like
这是它在新笔记本电脑上的样子: enter image description here
我尝试重新安装库并更改 python 解释器。
我提供了一些代码。
【问题讨论】:
-
Ubuntu 有不同的“主题”吗?也许操作系统相同但设置了不同的“主题”?
-
您可能需要询问 customtkinter 的作者。也许他们设计它看起来不同。
-
检查是否有规模系统设置展示配置。如果是,请检查两台笔记本电脑的设置是否设置为相同的值。
-
参见How to Ask。您需要提供 minimal reproducible example 和调试详细信息。发布屏幕截图而不是照片。并描述预期的内容和显示的内容。
-
请提供足够的代码,以便其他人可以更好地理解或重现问题。
标签: python ubuntu user-interface tkinter customtkinter