Set button active on ready?
Asked Answered
L

2

0

I have attached an image. 1 is the main menu. When I click on options button the options menu opens. But like in 2, the audio button remains in normal state. How do I set the button in active state when options menu opens by code? Like in 3.

Lightning answered 4/2 at 7:51 Comment(0)
U
0

You should add something along the lines of $"AudioButton.grab_focus()" in the code where you open the options menu. Or if there isn't any, add a small function that gets ran when the options button is pressed.

Unsung answered 4/2 at 10:56 Comment(0)
L
0

Actually I am already using grab_focus. But it does not work If I add more sub menu of audio or video etc. But, just after this post I found out that I need to select the button pressed option from the inspector. Thank you for your reply.
Edit: Just found out that there is a button_pressed function to set a button active on ready or when set visible.

Lightning answered 4/2 at 15:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.