fix checkboxes

This commit is contained in:
Somdev Sangwan 2023-06-01 11:32:47 +05:30 committed by GitHub
commit d3e29c0878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

9
run.py
View File

@ -145,11 +145,11 @@ def select_target():
def toggle_fps_limit(): def toggle_fps_limit():
args['keep_fps'] = limit_fps.get() != True args['keep_fps'] = int(limit_fps.get() != True)
def toggle_keep_frames(): def toggle_keep_frames():
args['keep_frames'] = keep_frames.get() != True args['keep_frames'] = int(keep_frames.get())
def save_file(): def save_file():
@ -252,13 +252,12 @@ if __name__ == "__main__":
target_button.place(x=360,y=320,width=180,height=80) target_button.place(x=360,y=320,width=180,height=80)
# FPS limit checkbox # FPS limit checkbox
limit_fps = tk.IntVar() limit_fps = tk.IntVar(None, not args['keep_fps'])
fps_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Limit FPS to 30", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=limit_fps, command=toggle_fps_limit) fps_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Limit FPS to 30", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=limit_fps, command=toggle_fps_limit)
fps_checkbox.place(x=30,y=500,width=240,height=31) fps_checkbox.place(x=30,y=500,width=240,height=31)
fps_checkbox.select()
# Keep frames checkbox # Keep frames checkbox
keep_frames = tk.IntVar() keep_frames = tk.IntVar(None, args['keep_frames'])
frames_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Keep frames dir", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=keep_frames, command=toggle_keep_frames) frames_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Keep frames dir", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=keep_frames, command=toggle_keep_frames)
frames_checkbox.place(x=37,y=450,width=240,height=31) frames_checkbox.place(x=37,y=450,width=240,height=31)