checkbox....

MarkMark Posts: 13Member
edited December 1969 in GUI
Hi Team<br /><br />I know there is a simple set of answers for the following, I just cant find the answer in the docs....<br /><br />I want to see the status of a checkbox, to see if it is checked or unchecked - I just dont know the command.<br /><br />I am assuming it would be something like "get_node("/root/panel/checkbox").get_status()"  <br /><br />So Godot gurus, what are the magical codes to get and set the status of a checkbox?<br /><br />Cheers<br /><br />Mark

Comments

  • MarkMark Posts: 13Member
    Update:<br /><br />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.<br /><br />Hope this helps others
  • danjodanjo Posts: 80Member
    Try
    get_node(&quot;/root/panel/checkbox&quot;).is_pressed()
    
    <br />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 ;)
  • 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.