Button Pressed Behavior control in App Designer.
87 views (last 30 days)
I created static text area with some text in an App using App Designer. I created a button when pressed makes the visibility of text to on. However, when I release the button the text area still shows up. I would like the text area to show up only when I am pressing button otherwise it should not be visible. How do i achieve this?
Kevin Chng on 1 Nov 2018
Edited: Kevin Chng on 1 Nov 2018
Initially, set text area to not visible. Refer to picture below.
Click TextArea component > Text Area Label & Properties (On your left bottom) > Configuration > Interactivity > Visible (untick)
Then in your button callback function
app.TextArea.Visible = 'on';
Harini Naveela on 17 Dec 2018
Please try the below code:
% Button pushed function: Button
function ButtonPushed(app, event)
% Button down function: UIFigure
function UIFigureButtonDown(app, event)
The above code makes the text area visible on clicking the button, and makes it invisible on releasing (UIFigureButtonDown). Note that we can make the text area back to invisible only by triggering some event (UIFigureButtonDown in this case). You can use any other event according to your use case, but as far as I understood your requirement, I hope UIFigureButtonDown will be enough. Also, do not forget to switch off the vsibility of text area intially. See below:
app.TextAreaLabel.Visible = 'off';
app.TextArea.Visible = 'off';