checkbox....

MarkMark Posts: 13Member
edited December 1969 in GUI
Hi Team

I know there is a simple set of answers for the following, I just cant find the answer in the docs....

I want to see the status of a checkbox, to see if it is checked or unchecked - I just dont know the command.

I am assuming it would be something like "get_node("/root/panel/checkbox").get_status()"   

So Godot gurus, what are the magical codes to get and set the status of a checkbox?

Cheers

Mark

Comments

  • MarkMark Posts: 13Member
    Update:

    I have worked around the issue by linking the Toggle event to the panel and via script and a Dictionary/Array combination I log when toggle events happen. This way I only need to refer to the dictionary/array combo to find the status.

    Hope this helps others
  • danjodanjo Posts: 80Member
    Try
    Code:
    get_node("/root/panel/checkbox").is_pressed()
    See: https://godotengine.org/qa/4923/how-to-get-the-status-of-the-checkbox-on-or-off
  • MarkMark Posts: 13Member
    yes, though that just triggers an 'is pressed' event, not an on or off status, which is why I changed my method of handling it as mentioned above Wink
  • danjodanjo Posts: 80Member
    No, is_pressed() returns true, when the checkbox is checked and false when it's not.
Sign In or Register to comment.