You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by shubhwins07 May 13, 2024
In my customtkinter programs(all of them), when I try to implement pywinstyles, the app does get transparent but the widgets just disappear, I have tried .update() .after() but none of them work, when I capture the screen(both screenshot and recording using window's tools), then the widgets are somehow visible but when i capture screen with OBS studio it isn't visible as in normal use. Could you please help me? I have written the code below-
Snipping tool screenshot
An image from OBS recording
import customtkinter as ctk
import time
import pywinstyles
window = ctk.CTk()
window.title("My Clock App")
window.geometry("300x200")
pywinstyles.apply_style(window, "acrylic")
stopwatchRunning = False
total_time = 0.0
start_time = None
def printtime(label):
global total_time
global start_time
if stopwatchRunning:
if start_time is None:
# Stopwatch just started or resumed, record the current time
start_time = time.time()
else:
# Stopwatch is still running, update the total time and the label
currenttime = time.time()
elapsed = currenttime - start_time
total_time += elapsed
total_time=round(total_time, 2)
label.configure(text=f"{total_time:.2f} secs")
# Record the current time for the next update
start_time = currenttime
label.after(50, printtime, label)
def start_stopwatch():
global stopwatchRunning
if not stopwatchRunning:
stopwatchRunning = True
printtime(label)
def stop_stopwatch():
global stopwatchRunning
global start_time
stopwatchRunning = False
# Reset the start time so the next start will know it's a new start
start_time = None
def restart_stopwatch():
global total_time
global start_time
global stopwatchRunning
total_time = 0.0
start_time = None
stopwatchRunning = False
label.configure(text="0.00 secs")
label = ctk.CTkLabel(window, text="00:00.00 secs", font=("SF Pro Display", 24))
start_button = ctk.CTkButton(window, text="Start",command=start_stopwatch)
stop_button = ctk.CTkButton(window, text="Stop", command=stop_stopwatch)
restart = ctk.CTkButton(window, text="Restart",command=restart_stopwatch)
label.pack(pady=10)
start_button.pack(pady=5)
stop_button.pack(pady=5)
restart.pack(pady=5)
window.mainloop()
```</div>
The text was updated successfully, but these errors were encountered:
@littlewhitecloud I am also not getting any issue like this, using the latest OBS version.
I also searched about this and found that it can be a permission issue of obs, or maybe the obs version is outdated.
If it's any help, I have graphical issues with CustomTkinter if used in combination with specific ttk widgets (scrollbars mainly, but most widgets outside of Treeview with styling) when using/forcing dark mode (both Linux and Windows). I only discovered this when I needed the Treeview and wanted it themed in my otherwise fully-CTk UI. ttk themes and styles seem interoperable (alongside something like svt-ttk for example) with any widget styles or color themes except for CTk. I wish I had examples and code, but I will try to recreate and update when at home in IDE.
Discussed in #27
Originally posted by shubhwins07 May 13, 2024
In my customtkinter programs(all of them), when I try to implement pywinstyles, the app does get transparent but the widgets just disappear, I have tried .update() .after() but none of them work, when I capture the screen(both screenshot and recording using window's tools), then the widgets are somehow visible but when i capture screen with OBS studio it isn't visible as in normal use. Could you please help me? I have written the code below-
Snipping tool screenshot
An image from OBS recording
The text was updated successfully, but these errors were encountered: