title: How would I make a command check whether a window has the attributes of Fullscreen as True or False
body: <p>So I am trying to make some simple buttons that allow the user to minimize and maximize the app window and I am trying to make it so a button can be pressed to set the window as fullscreen and when in fullscreen it can be pressed again to set the window in windowed mode. I have tried to set the window attributes for fullscreen as functions to make an if else statement but all that would happen is that the app would go fullscreen and if I press the button again it would only minimize for a second before going back to fullscreen.</p>
  <pre><code>import tkinter.messagebox
  from tkinter import *
  import customtkinter
  from PIL import Image, ImageTk
  import sys
  
  customtkinter.set_appearance_mode(&quot;dark&quot;) # Modes: System(default), Light, Dark
  customtkinter.set_default_color_theme(&quot;dark-blue&quot;) #modes: blue, dark-blue, green
  
  window = customtkinter.CTk()
  window.title(&quot;To-Do List&quot;)
  #window.overrideredirect(1)
  
  #fullscreen
  def Fulwin():
      window.attributes('-fullscreen', True)
  #windowed mode
  def Nonwin():
      window.attributes('-fullscreen', False)
  
  
  ## Minimize, maximize, and exit button
  
  def Ifullscreen():
      if Fulwin:
          Nonwin
      else: Fulwin
  
  #Maxamize/Minimize Button
  
  maximize_image = ImageTk.PhotoImage(Image.open(&quot;GUI/Maximize.png&quot;))
  maximize_button = customtkinter.CTkButton(master=window, image=maximize_image, text=&quot;&quot;,command=Ifullscreen,
                                            width=30, height=30, fg_color='#1a1a1a', hover_color='#1a1a1a')
  maximize_button.pack(padx=5,pady=5)
  maximize_button.place(x=1450,y=10)
  
  #Hide Button
  def Minsize():
      window.attributes('-fullscreen',False)
  minimize_image = ImageTk.PhotoImage(Image.open(&quot;GUI/minimize.png&quot;))
  minimize_button = customtkinter.CTkButton(master=window, image=minimize_image, text=&quot;&quot;, command=Minsize,
                                            width=30, height=30, fg_color='#1a1a1a', hover_color='#1a1a1a')
  minimize_button.pack(padx=5,pady=5)
  minimize_button.place(x=1400,y=10)
  
  #Exit Button
  def Exsize():
      sys.exit()
  exit_image = ImageTk.PhotoImage(Image.open(&quot;GUI/exit.png&quot;))
  exit_button = customtkinter.CTkButton(master=window, image=exit_image, text=&quot;&quot;, command=Exsize,
                                        width=30, height=30, fg_color='#1a1a1a', hover_color='#1a1a1a')
  exit_button.pack(padx=5,pady=5)
  exit_button.place(x=1500,y=10)
  
  window.mainloop()
  </code></pre>