You are here

버턴으로 선택해제을 만드려고 하는데

image create photo actcheck16 -data {
   R0lGODlhEAAQAIIAAPwCBMT+xATCBASCBARCBAQCBEQCBAAAACH5BAEAAAAA
   LAAAAAAQABAAAAM2CLrc/itAF8RkdVyVye4FpzUgJwijORCGUhDDOZbLG6Nd
   2xjwibIQ2y80sRGIl4IBuWk6Af4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYg
   UHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJp
   Z2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
}
image create photo playstop22 -data {
   R0lGODlhFgAWAIUAAPwCBAQCBAwKDBQSFBwaHCQmJJSSlISChJSOlJSWlGxq
   bGRiZNTS1PTy9Pz+/Ozm7OTi5FRSVIyKjOTe5MTCxIR+hExOTHR2dLy6vLSy
   tLy2vHRydFxWXIyGjIyOjPz2/FRWVHx6fExKTMzOzJyanKSmpKyqrKSipAQG
   BLSutHx2fDw6PAwODAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa1
   QIBwSCwaj8ikcslsAgKCAWEQjQ4KgSwyYDAcugZEQqFYYJECA6PhaLcfEEUk
   gJZAGJB8fkKpWOhHAxcOGBQZGBoaGQgbHIBGAhUOGR0SBxISBh4Xf0iCHxQS
   lRIIXhsgj0UCIaCXmJgHGyKpRJ+hmB5dHQqOaCENIx0epBIkBhdzngoPGCQl
   JifQJBvJRygRKRcKGxcXGypys1srEREc5SLnICLiR1koLFVUWfRO9vf4+Uwy
   QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBE
   ZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRw
   Oi8vd3d3LmRldmVsY29yLmNvbQA7
}

frame .gen
                                                                 
set i 1
set a 1
while { $i<=5 } {
    button .gen.g$i -image playstop22 -width 10 -height 10
                  -command {
                   
                   if {$a == 1} {
                   [.gen.g$i config -image actcheck16]
                   set  a 2
                   } elseif {$a == 2} {
                   [.gen.g$i config -image playstop22]
                   set  a 1
                   }
                  }
    pack .gen.g$i -side left -expand true -fill both -padx 1
    incr i
}
pack .gen -expand true -fill both -pady 1

버턴으로 선택 해제 을 만들려고 합니다.
근데 생각처럼 되지 않고 에라을 발생 하더군요
중간에 command 라인에 연산수식이 들어 가면 안되는지요..
다른 방법으로 만들수 있는지 궁금 합니다.