You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI all,
i am struggling with the following problem. I can't find a solution reading the documentation so i am asking here.
Let's assume i want to deploy a feedback stage for a certain application.
Let's assume i have a text-box for output and two button for input like the following:
import ipywidgets as ipw
from ipywidgets import Layout
txt_out=ipw.Textarea(
value='are you interested in leaving a feedback?',
disabled=True,
layout=Layout(border='solid 1px', width = '650px', height = '150px', )
)
yes=ipw.Button(
description='',
disabled=False,
button_style='info', # 'success', 'info', 'warning', 'danger' or ''
tooltip='Yes',
icon='thumbs-up',
layout=Layout(height='50px')
)
no=ipw.Button(
description='',
disabled=False,
button_style='info', # 'success', 'info', 'warning', 'danger' or ''
tooltip='No',
icon='thumbs-down',
layout=Layout(height='50px'))
box1=ipw.HBox([yes,no])
box2=ipw.VBox([txt_out,box1])
display(box2)
Wich results like:
How can i wait for the user press a button inside a function? I would use thread, but exactly wich function should i thread? I cant thread directly the on_click button function, am i right?
The goal is change txt_out.value according to user choice (multiple times, indeed).
Appreciate your help
Thanks
The text was updated successfully, but these errors were encountered:
to regester input form a text box u can use txt_out.observe(function, names="value") this checks if the user pressed enter. If u need to have them press the button u can use yes.on_click(function). If u need to make sure the user gave an input before pressing yes, use the following: yes.on_click(lambda PlaceHolder: function(PlaceHolder) if txt_out.value else None)
This makes sure that there is a input before activating the function. you could also use the txt_out.value in your function to give feadback or a errormessage
HI all,
i am struggling with the following problem. I can't find a solution reading the documentation so i am asking here.
Let's assume i want to deploy a feedback stage for a certain application.
Let's assume i have a text-box for output and two button for input like the following:
Wich results like:
How can i wait for the user press a button inside a function? I would use thread, but exactly wich function should i thread? I cant thread directly the on_click button function, am i right?
The goal is change txt_out.value according to user choice (multiple times, indeed).
Appreciate your help
Thanks
The text was updated successfully, but these errors were encountered: