Trouble initiating a DateEntry widget in tkcalendar inside of another class

I want to write a class that creates a paired checkbox and a corresponding DateEntry widget any number of times a new instance is created.
All the instances are children to one single window, this class must be able to manipulate the date in the DateEntry widget as follows:

  1. If it’s initiated like checkNdate(window, "Fecha de solicitud", ""), then the instance should show the checkbox set in FALSE and NOT SHOW the DateEntry widget

  2. If it’s initiated like a particular date like checkNdate(window, "Fecha de solicitud", "16-05-2024"), the checkbox must be shown as TRUE and SHOW the DateEntry widget in the selected date.

  3. If the widget was loaded in the first case, once we hit the checkbox and set it to TRUE, the DateEntry widget must appear and the user should select a date.

  4. If the checkbox is set to FALSE after being in TRUE, the DateEntry widget must be hidden.

  5. The purpose of this is that another button, will connect to a SQL table and send the dates from the DateEntry widgets that have their corresponding checkbox set to TRUE or send None if the checkbox is FALSE.

import tkinter as tk
from tkinter import ttk
from tkcalendar import DateEntry

class checkNdate(ttk.Frame):
    def __init__(self, parent: ttk.Widget, checkButton_name: str, date_or_none): 
        super().__init__(master=parent)

        # layout of the widgets
        self.rowconfigure(0, weight = 1)
        self.columnconfigure((0 , 1), weight = 1, uniform = "a")
        
        # set the checkbutton
        ttk.Checkbutton(master = self, text = checkButton_name, ).grid(row = 0, column = 0, sticky = "nsew")
        # show the calendar if date exists
        if date_or_none != (None or ""):
            # code to check in which case we are, ignore this print
            print("date is :", date_or_none)
            
            # calling this DateEntry widget creates the error.
            cal = DateEntry(master=parent)
            cal.grid(row = 0, column = 1)
            cal.set_date(date_or_none)
            
            #DateEntry.set_date(date_or_none)
        else:
            # code to check in which case we are, ignore this print
            print("date is :", date_or_none)
            

        self.pack()

# this next code only is for testing purposes
window = tk.Tk()
window.title = "check n' date"
window.geometry("300x300")

# widgets for testing purposes
checkNdate(window, "Fecha de solicitud", "")
checkNdate(window, "Fecha de solicitud", "16-05-2024")

# run
window.mainloop()

I know that so far, the code doesn’t bind the checkbox to the creation or destruction of the DateEntry widget but my current problem is that this error pops when I try to load the DateEntry on those two examples. I think is a class inheritance issue but I’m not sure

date is : 
date is : 16-05-2024
Traceback (most recent call last):
  File "/Users/hidari/Coding/cs50py/project/prueba_class_check_calendar.py", line 42, in <module>
    checkNdate(window, "Fecha de solicitud", "16-05-2024")
  File "/Users/hidari/Coding/cs50py/project/prueba_class_check_calendar.py", line 24, in __init__
    cal = DateEntry(master=parent)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tkcalendar/dateentry.py", line 123, in __init__
    self._top_cal = tk.Toplevel(self)
                    ^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2695, in __init__
    self.title(root.title())
               ^^^^^^^^^^^^
TypeError: 'str' object is not callable

New contributor

Edgard Huerta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật