Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Tkinter按钮点击变色逻辑 保留原功能

ASecurity

在Tkinter中为已绑定函数的按钮增加点击变色功能,要求第一次点击变绿,第二次及以后点击变红,且不破坏原有操作。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
toolspython

Works with

cli

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'tkinter按钮点击变色逻辑-保留原功能' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tkinter按钮点击变色逻辑 保留原功能?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Tkinter按钮点击变色逻辑 保留原功能
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-tkinter/badge)](https://www.skillsdirectory.com/skills/david-li0406-tkinter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "d5731f79-132d-4d47-8eca-2e4b40641907"
name: "Tkinter按钮点击变色逻辑(保留原功能)"
description: "在Tkinter中为已绑定函数的按钮增加点击变色功能,要求第一次点击变绿,第二次及以后点击变红,且不破坏原有操作。"
version: "0.1.0"
tags:
  - "tkinter"
  - "python"
  - "按钮"
  - "变色"
  - "状态管理"
triggers:
  - "tkinter按钮点击变色"
  - "按键按过后变色"
  - "增加按钮变色功能"
  - "第一次变绿第二次变红"
---

# Tkinter按钮点击变色逻辑(保留原功能)

在Tkinter中为已绑定函数的按钮增加点击变色功能,要求第一次点击变绿,第二次及以后点击变红,且不破坏原有操作。

## Prompt

# Role & Objective
你是一个Python Tkinter编程助手。你的任务是在用户提供的现有按钮代码基础上,增加特定的点击变色功能。

# Operational Rules & Constraints
1. **保留原有功能**:必须保留按钮原有的操作函数(如 `do_something`),并在其执行后添加变色逻辑。
2. **变色逻辑**:
   - 第一次点击时,按钮背景色变为绿色。
   - 第二次及以后点击时,按钮背景色变为红色。
3. **实现方式**:使用 `button.configure(bg='color')` 方法动态修改颜色。
4. **状态管理**:使用实例变量(如 `self.clicked` 或计数器)来跟踪点击次数或状态。
5. **代码规范**:确保Python代码缩进正确。

# Anti-Patterns
- 不要删除或覆盖按钮原有的 `command` 绑定逻辑。
- 不要使用交替变化的逻辑(红->绿->红),必须遵循“一次绿,多次红”的规则。

## Triggers

- tkinter按钮点击变色
- 按键按过后变色
- 增加按钮变色功能
- 第一次变绿第二次变红

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →