1

I have an app the produces a report based on a 7 day timedelta query. My users want this changed so they can pick a start date and an end date for the report query

I obtained a calendar dialog at How do I create a date picker in tkinter?, which works independent of my code but I cannot get it to execute within my app. I am trying to import the demo into my app so I can call it from a menu button. Unfortunately I am struggling with how to do this. Is this the proper method or should I transfer the entire code? Any suggestions would be appreciated

from tkinter import *
from tkinter.ttk import *
from tkinter import filedialog
import tkinter.messagebox
from CalendarDialog import *

root = Tk() 
master = Frame(root, name='master') 
master.pack(fill=BOTH) 
root.geometry("800x800+300+100")
root.title('WeeklyReport')
menu_bar = Menu(root)
root.config(menu=menu_bar)

def exit():
   root.destroy()

def GetCalendar():
   calender = CalenderDialog()
   root.wait_window

filemenu = Menu(menu_bar, tearoff=0)
menu_bar.add_cascade(label="File", menu=filemenu)
filemenu.add_command(label="Exit", command=exit)

datemenu = Menu(menu_bar)
menu_bar.add_command(label='Change Date', command=GetCalendar)
Community
  • 1
  • 1
pja
  • 125
  • 2
  • 4
  • 19

1 Answers1

0

I figured it out!

def GetCalendar()
    os.system("CalendarDialog.py")
root.wait_window

Now to get it to do what I need it to do...

pja
  • 125
  • 2
  • 4
  • 19