-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathingredients.py
33 lines (24 loc) · 851 Bytes
/
ingredients.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from taipy.gui import Gui, notify
def display_ingredients(ingredientsArray):
for ingredient in ingredientsArray:
print(ingredient)
# Function to be called when the generate_recipes button is clicked
def generate_recipes_clicked(state):
notify(state, 'info', f'The text is: {state.text}')
state.text = "Button Pressed"
# Function to be called when the X button is clicked, it will delete the ingredient
def delete_ingredient(state):
notify(state, 'info', f'The text is: {state.text}')
state.text = "Button Pressed"
text = "Original text"
# Definition of the page
ingredients_md = """
# Ingredients Cart
<|layout|columns=1 1|
Ingredient
<|X|button|on_action=delete_ingredient|>
|>
<|Generate Reciples|button|on_action=generate_recipes_clicked|>
"""
# Gui(page).run(use_reloader=True, port=8008)
### This is a test!!