Skip to content

Choose a tag to compare

@mbcraft-exe mbcraft-exe released this 31 May 17:09
· 2 commits to main since this release
5594b98

⚠️ MAJOR UPDATE
Interactive_buttons V4 has completly changed the way this module changed.
It also let the user only use matrix_buttons for the moment.

Here is an updated example of how this lib should be used :

from interactive_buttons import Button, Component
from colorama import Fore, Back

# Create buttons
buttons = [
    Button(label="Value A1", value="A1"),
    Button(label="Value A2", value="A2"),
    Button(label="Value B1", value="B1"),
    Button(label="Value B2", value="B2"),
]

# Create a custom component
component = Component(
    buttons=buttons,
    text_color=Fore.BLACK,
    highlight_color=Back.YELLOW,
    spaces_count=10,
    left_decorator="<",
    right_decorator=">"
)

# Launch the interactive interface
value = component.matrix_buttons()

# Print the selected value
print(f"Selected value: {value}")

Output :