その1
その2
# ボタンを押した時の動作 proc push_button_A {} { global buffer set buffer "ボタンAを押しましたね" pack forget .b2 } # ボタンを押した時の動作 proc push_button_B {} { global buffer set buffer "ボタンBを押しましたね" } # ラベルの作成 label .l -textvariable buffer pack .l #ボタンの作成 button .b1 -text "button A" -command "push_button_A" button .b2 -text "button B" -command "push_button_B" # オプションの追加 pack .b1 pack .b2 # button .b1 -text "A" -command "push_button_A" # button .b2 -text "B" -command "push_button_B" # # オプションの追加 # pack .b1 -side left -fill both # pack .b2 -side left -fill both
その2
# ボタンを押した時の動作 proc push_button_A {} { global buffer set buffer "ボタンAを押しましたね" pack forget .b1 pack forget .b2 pack .next } # ボタンを押した時の動作 proc push_button_B {} { global buffer set buffer "ボタンBを押しましたね" pack forget .b1 pack forget .b2 pack .next } # ボタンを押した時の動作 proc push_button_NEXT {} { global buffer set buffer "ボタンを押して下さい" pack forget .next # オプションの追加 pack .b1 pack .b2 } # ラベルの作成 label .l -textvariable buffer pack .l #ボタンの作成 global buffer set buffer "ボタンを押して下さい" button .b1 -text "button A" -command "push_button_A" button .b2 -text "button B" -command "push_button_B" button .next -text "NEXT" -command "push_button_NEXT" # オプションの追加 pack .b1 pack .b2 # pack .b1 -side left -fill both # pack .b2 -side left -fill both
タグ
コメントをかく