pip helper

This commit is contained in:
dengrb1 2023-05-06 17:29:43 +08:00 committed by GitHub
parent 57fcdcb6f9
commit 88a98d1001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

View File

@ -4,6 +4,8 @@ import os
# 创建主窗口
root = Tk()
ml = os.getcwd()
file_error = '文件丢失,请重新安装'
# 创建滚动区域的Canvas对象
canvas = Canvas(root, width=280, height=280, scrollregion=(0, 0, 500, 500))

29
install2.pyw Normal file
View File

@ -0,0 +1,29 @@
from tkinter import *
from tkinter import messagebox
import os
# 创建主窗口
root = tk.Tk()
root.title("Scrollable Button Grid")
root.geometry("300x300")
# 创建滚动区域的Canvas对象
canvas = tk.Canvas(root, width=280, height=280, scrollregion=(0, 0, 500, 500))
# 创建可滚动区域的Frame对象并将其添加到Canvas中
scroll_frame = tk.Frame(canvas)
scroll_frame.bind("<Configure>", lambda e: canvas.configure(scrollregion=canvas.bbox("all")))
canvas.create_window((0, 0), window=scroll_frame, anchor="nw")
# 创建Scrollbar对象并将其绑定到Canvas上
scrollbar = tk.Scrollbar(root, orient="vertical", command=canvas.yview)
canvas.configure(yscrollcommand=scrollbar.set)
scrollbar.pack(side="right", fill="y")
# 在Frame中添加多个Button对象
for i in range(50):
button = tk.Button(scroll_frame, text=f"Button {i+1}")
button.pack(pady=5)
# 显示Canvas和Scrollbar
canvas.pack(side="left", fill="both", expand=True)