|
发表于 2007-1-24 23:51:34
|
显示全部楼层
All of your questions should be answered by below codes
- #!/usr/bin/python
- from Tkinter import *
- root = Tk()
- root.title('hello') # set title
- root.resizable(0,0) # can't resize now. change '0' to '1' to see what happened ?
- var = IntVar()
- Radiobutton(root, text='a', variable=var, value='value1').pack(anchor=NW)
- Radiobutton(root, text='b', variable=var, value='value2').pack(anchor=NW)
- var.set('value2') # select the second button (its value is 'value2')
- root.mainloop()
复制代码 |
|