Enabled Textbutton Display on Preference Screen
Posted: Mon Feb 17, 2020 9:21 pm
I have a small script I'm adding that changes a persistent variable. I finally got it to turn on and off with the use of a function. I couldn't use SetVariable because it gave me a split error. So I created a basic function that takes the type and changes the persistent variable. However, the textbutton doesn't show that it's already enabaled on the preference screen one way or the other such as it does with the windowed and full screeen adding the line. What am I missing to change this?
Code: Select all
vbox:
style_prefix "radio"
label _("Read-Mode")
textbutton _("NVL") action Function(turn_on_nvl, 1)
textbutton _("ADV") action Function(turn_on_nvl, 0)
Code: Select all
init python:
def turn_on_nvl(type):
if type == 0:
persistent.nvl = False
else:
persistent.nvl = True