Skip to content

(Solved) window resizable and grab_set causes white flicker when using dark mode #2469

Answered by dipeshSam
ageekhere asked this question in Q&A
Discussion options

You must be logged in to vote

@ageekhere

Got it! Here is your solution:

I closely inspected the problem and found that the issue persists because of internal overriding of .resizable() function in CTkToplevel class which delays in setting title bar color of the window, and not in setting background color only. So, let's define external handles for them.

Updated code:

import customtkinter
from customtkinter import CTkToplevel
from customtkinter import get_appearance_mode
from tkinter import Toplevel
import ctypes, sys

def external_handle_for_titlebar(win: CTkToplevel):
    color_mode = get_appearance_mode()

    if sys.platform.startswith("win"):
        if color_mode.lower() == "dark":
            value = 1
        elif

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@ageekhere
Comment options

Comment options

You must be logged in to vote
6 replies
@dipeshSam
Comment options

@ageekhere
Comment options

@dipeshSam
Comment options

@ageekhere
Comment options

@dipeshSam
Comment options

Answer selected by ageekhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants