こんな感じですかね?
lang
1#!/usr/bin/env python
2# -*- coding: utf8 -*-
3import sys
4from Tkinter import *
5import tkMessageBox
6
7
8root = Tk()
9root.title(u"Software Title")
10root.geometry("400x300")
11
12
13# 状態の変更
14def change_state():
15 # チェックされているラジオボタンを取得
16 checked = v.get()
17
18 if ( checked == 1 ):
19 # radio1がチェックされていたら
20 radio2.configure( state = "disabled" )
21 radio3.configure( state = "disabled" )
22
23 elif ( checked == 2 ):
24 # radio2がチェックされていたら
25 radio1.configure( state = "disabled" )
26 radio3.configure( state = "disabled" )
27
28
29 elif ( checked == 3 ):
30 # radio3がチェックされていたら
31 radio1.configure( state = "disabled" )
32 radio2.configure( state = "disabled" )
33
34 else:
35 print "error"
36
37
38
39
40# ラジオボタンのグループ
41v = IntVar()
42v.set(0)
43
44
45# ラジオボタン
46radio1 = Radiobutton(text = u"項目1", variable = v, value = 1, command = change_state)
47radio1.pack()
48
49radio2 = Radiobutton(text = u"項目2", variable = v, value = 2, command = change_state)
50radio2.pack()
51
52radio3 = Radiobutton(text = u"項目3", variable = v, value = 3, command = change_state)
53radio3.pack()
54
55
56root.mainloop()
57
ラジオボタンの作成時に、command = クリックされたときに実行する関数
をもたせ、
その関数(今回はchange_state
)で、他のラジオボタンを全て無効化する用に設定します。