Xiaokang2022 / tkintertools

The tkintertools is a UI framework based on the Canvas class of tkinter. In other words, all the UI is drawn in Canvas!
https://xiaokang2022.github.io/tkintertools/
MIT License
433 stars 21 forks source link

对窗口大小的操作做仅对内部生效对窗口无效 #19

Closed anotherATTCK closed 4 months ago

anotherATTCK commented 4 months ago

🔖 Version

Latest stable version (Default)

🔥 Platform

Windows 11

❓What Happened

只是显示错误没有报错 self.HEIGHT = 720 image self.HEIGHT = 72 image

📑 Relevant Log Output

No response

✏️ Extra Information

已通过print大法确定了运行顺序没有问题 实现代码 import tkintertools as tkt # 引入 tkintertools

class GUI: def init(self): self.win_name = 'AUTO PY TO EXE PRO' self.WIDTH = 1280 # 窗口宽度 self.HEIGHT = 72 # 窗口高度 self.root = tkt.Tk(self.win_name, self.WIDTH, self.WIDTH) # 创建窗口 print(1)

def main(self):
    self.root.mainloop()  # 窗口进入消息事件循环

def home(self):
    X = 0  # 画布左上角横坐标
    Y = 0  # 画布左上角纵坐标
    BACKGROUND = '#BEE7E9'  # 画布背景颜色
    canvas = tkt.Canvas(self.root, self.WIDTH, self.HEIGHT, X, Y, background=BACKGROUND)  # 创建画布

    # 第三部分
    canvas.create_text(640, 200, text='账 号 登 录', font=(tkt.FONT, 60))  # 文本显示
    tkt.Entry(canvas, 450, 360, 380, 50, text=('账号', '点击输入账号'))  # 账号输入框
    tkt.Entry(canvas, 450, 430, 380, 50, text=('密码', '点击输入密码'), show='●')  # 密码输入框
    tkt.Button(canvas, 450, 500, 180, 50, text='注册')  # 注册按钮
    tkt.Button(canvas, 650, 500, 180, 50, text='登录')  # 登录按钮
    # GUI.main(self)
    print(2)
    self.root.mainloop()  # 窗口进入消息事件循环

if name == 'main': GUI().home()

✉️ Contact Details

2065796644@qq.com

⚠️ Code of Conduct

Xiaokang2022 commented 4 months ago

https://xiaokang2022.github.io/tkintertools/news/2.6.21/News/ 红色框部分说明,tkt 2 已不再更新,也不会得到任何问题的修改。

Xiaokang2022 commented 4 months ago

个人时间和精力有限,请谅解!

Xiaokang2022 commented 4 months ago

若有疑问,请到讨论区中的问答模块提问:https://github.com/Xiaokang2022/tkintertools/discussions/categories/q-a