mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2024-11-07 18:40:13 +03:00
19 lines
547 B
Python
19 lines
547 B
Python
'''
|
|
This file contains the CardItem class which represents a single card in the memory game.
|
|
'''
|
|
import tkinter as tk
|
|
class CardItem:
|
|
def __init__(self, value):
|
|
self.value = value
|
|
self.button = None
|
|
self.is_visible = False
|
|
def __str__(self):
|
|
return str(self.value)
|
|
def show(self):
|
|
# Show the card value
|
|
self.button.config(text=str(self))
|
|
self.is_visible = True
|
|
def hide(self):
|
|
# Hide the card value
|
|
self.button.config(text=" ")
|
|
self.is_visible = False |