python tkinter实现侧面弹出窗口,(tkinter侧拉窗口,tkinter滑动窗口),连续多次点击弹窗按钮,重复打开窗口问题

本文介绍了一个使用Tkinter实现的可折叠窗口应用案例,该程序能够控制弹窗的显示与隐藏,并解决了快速连续点击按钮导致的窗口重复打开问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,效果

2,代码

在这里插入图片描述

from tkinter import *
import time

class FloadWindow(object):
    def __init__(self, shape, locate):
        self.wnd = Tk()
        s_shape = str(shape[0])+'x'+str(shape[1])
        s_locate = '+' + str(locate[0]-shape[0]) + '+' + str(locate[1])
        self.wnd.overrideredirect(True)
        
        path = ['camera_1', 'camera_2', 'camera_3', 'camera_4', 'camera_5', 'camera_6']
        for i in range(len(path)):
            label = Label(self.wnd, text=path[i])
            label.place(x=0,y=i*15+5)

        for width in range(0, shape[0], int(shape[0]/20)):
            time.sleep(0.01)
            self.overturn((width, shape[1]), locate)
    def overturn(self, shape, locate):
        s_shape = str(shape[0])+'x'+str(shape[1])
        s_locate = '+' + str(locate[0]-shape[0]) + 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值