hi , thanks for the code , I have changed it a little bit , I have also added two buttons (+,-)
I have written the code for (+) but it does not work , can you tell me what the problem is , the last lines which are commented out are supposed to show the following months but I keep getting error s .
thanks
#------------------------------------------------------------------------
from Tkinter import *
from calendar import *
y=2007
m=1
str1=month(y,m)
class MyApp:
def __init__(self,myparent):
self.mycontainer = Frame(myparent)
self.mycontainer.pack()
root.title("monthly calendar")
l2=Label(self.mycontainer,text= str1,justify="left",font=('courier',14,'bold'),bg='yellow')
l2.pack()
self.b1=Button(self.mycontainer,text='-',bg="green",padx=5,pady=5)
self.b1.pack(side=LEFT,ipadx=3,ipady=1)
self.b2=Button(self.mycontainer,text='+',bg="red",padx=5,pady=5)
self.b2.pack(side=RIGHT,ipadx=3,ipady=1)
self.b2.bind("<Button-1>",self.increase)
# def increase(self):
# if self.m==12:
# self.m=1
# self.y=self.y + 1
# else:
# self.m=self.m+1
if __name__ == '__main__':
root=Tk()
myapp=MyApp(root)
root.mainloop()