# File: Manager.py
from Tkinter import *
class Manager:
def choose(self,master):
tasksf=Frame(master)
tasksf.grid(row=1,column=0,padx=3,pady=3)
Label(tasksf, text="Task ID:").grid(row=0,column=0,padx=3,pady=3)
Label(tasksf, text="Description:").grid(row=1,column=0,padx=3,pady=3)
Label(tasksf, text="Start Date:").grid(row=2,column=0,padx=3,pady=3)
Label(tasksf, text="Deadline:").grid(row=3,column=0,padx=3,pady=3)
self.tid=Entry(tasksf)
self.tdesc=Entry(tasksf,width=25)
self.tstart=Entry(tasksf)
self.tdead=Entry(tasksf)
self.tid.grid(row=0,column=1,padx=15,pady=5,sticky=W)
self.tdesc.grid(row=1,column=1,padx=15,pady=5,sticky=W)
self.tstart.grid(row=2,column=1,padx=15,pady=5,sticky=W)
self.tdead.grid(row=3,column=1,padx=15,pady=5,sticky=W)
def asdfg(self,master):
print "dsgsfd ",v
def __init__(self,master):
master.title("Manager")
menuf=Frame(master)
v = IntVar()
Radiobutton(menuf, text="Tasks", variable=v,indicatoron=0, value=11,command=self.choose(master)).grid(row=0,column=0,padx=5,pady=5,ipadx=5,ipady=5)
Radiobutton(menuf, text="Meeting", variable=v,indicatoron=0, value=22,command=self.asdfg(master)).grid(row=0,column=1,padx=5,pady=5,ipadx=5,ipady=5)
Radiobutton(menuf, text="Profiles", variable=v,indicatoron=0, value=33,command=self.asdfg(master)).grid(row=0,column=2,padx=5,pady=5,ipadx=5,ipady=5)
menuf.grid(row=0,column=0,padx=3,pady=3)
print "var ",v
# def validate(self):
root = Tk()
app = Manager(root)
root.mainloop()
Hi,
I am quite new to python and am having some problem with it regarding the GUI portion. I am using TkInter module for the GUI. I am using it for a project. When you run the above the program you get to see a entire frame at one go, whereas what i am trying for is that the "tasks" button is pressed, the textboxes nad labels appear in a different frame connected to current frame. I used the 'command' option for callback function but it seems to running like a normal function with 'textboxes' frame showing before the "tasks" button is pressed.
The 'print' statements were for debugging purpose only but to no avail..
Please Help
Thanks