From: Noritugu Nakamura Date: 1997-01-19T23:29:06+09:00 Subject: [ruby-list:1770] variable and value (TkRadioButton) 中村です。 ↓と同じのを ruby/Tk で書いたつもりなのですが、 同じ動作をしません。どうしてでしょうか? #!/usr/local/X11R6/bin/wish4.2 set flavor "chocolate" radiobutton .top -text "Chocolate Flavor" \ -variable flavor -value chocolate -anchor w radiobutton .center -text "Strawberry Flavor" \ -variable flavor -value strawberry -anchor w radiobutton .bottom -text "Lemon Flavor" \ -variable flavor -value lemon -anchor w pack .top .center .bottom -fill x entry .e -textvariable flavor pack .e -fill x button .quit -text QUIT -foreground red -command exit pack .quit -side bottom -fill both #!/usr/local/bin/ruby require "tk" $flavor = "chocolate" TkRadioButton.new { text 'Chocolate Flavor' variable :$flavor value 'chocolate' anchor 'w' pack('fill' => 'x') } TkRadioButton.new { text 'Strawberry Flavor' variable :$flavor value 'strawberry' anchor 'w' pack('fill' => 'x') } TkRadioButton.new { text 'Lemon Flavor' variable :$flavor value 'lemon' anchor 'w' pack('fill' => 'x') } TkEntry.new { textvariable :$flavor pack('fill' => 'x') } TkButton.new { text 'QUIT' foreground 'red' command 'exit' pack('side' => 'bottom', 'fill' => 'both') } Tk.mainloop ちなみにこの例は↓をコンバートしたつもりです。 Python-1.4/Demo/tkinter/matt/radiobutton-simple.py 中村典嗣@京都大学大学院工学研究科電子通信工学専攻 E-mail: nnakamur@tamaru.kuee.kyoto-u.ac.jp