How can I make a tkinter Button
completely fill the entire gui temporarily, and then after hitting said button, return to previous state.
I tried setting the button to my "highest level" frame and using the expand and fill config settings, this made the Button
pretty big, but ultimately it only filled the bottom 1/3 of my gui.
... other instantiations...
#Initialization of button in gui as whole
toggleBacklightButton = Button(patternOptionFrame,text="Screen Light",
font=('calibri',(10)),relief="raised",
command=toggleBacklight)
toggleBacklightButton.grid(row=0,column=3)
... other code...
#Function that the button press calls.
def toggleBacklight():
global backlight_toggle
backlight_toggle = not backlight_toggle
if backlight_toggle is True:
# Button should be as it was when instantiated AND back light
# is on / all other ~20 widgets are also where they belong.
os.system(
"sudo sh -c 'echo \"0\" > /sys/class/backlight/rpi_backlight/bl_power'")
else:
# Button should fill entire screen for ease of access when
# screen is black / all other ~20 widgets are hidden.
os.system(
"sudo sh -c 'echo \"1\" > /sys/class/backlight/rpi_backlight/bl_power'")
... other functions...
The button does toggle my touch screen display, however, I don't know how to make it take up the whole screen when the screen back light is off.