Akascape / py-window-styles

Customize your python UI window with awesome pre-built windows 11 themes.
Creative Commons Zero v1.0 Universal
323 stars 16 forks source link

My widgets are not showing #26

Closed shubhwins07 closed 4 months ago

shubhwins07 commented 4 months ago

when I apply semi transparent themes like aero, transparent and acrylic, my widgets are no longer visible in customtkinter.

Akascape commented 4 months ago

You have to use set_opacity method in the widgets to make them visible. Example:

import tkinter
import customtkinter
from PIL import Image
import pywinstyles

# code generated with ctkdesigner

HEIGHT = 500
WIDTH = 500

app = customtkinter.CTk()
app.title("")
app.geometry((f"{WIDTH}x{HEIGHT}"))
app.resizable(False, False)

pywinstyles.apply_style(app, "acrylic")

Button1 = customtkinter.CTkButton(app, width=200, height=100, corner_radius=20, bg_color="#000001")
Button1.place(x=150, y=100)

pywinstyles.set_opacity(Button1, value=0.8, color="#000001")

app.mainloop()

image