2016-01-22 29 views
0

我一直在Xcode中玩耍,目前正在使用NSMatrix的NSButtonCells,但碰到了一個路障。我想要一個僅在2行顯示5個單選按鈕的矩陣。 (從技術上講,一個2乘3,一個不可見)這是一個不斷變化的矩陣,可以有更多或更少的單選按鈕。所以我正在做一些能夠關閉未使用的單選按鈕的東西。似乎有一個調用NSButtonCell使其透明。 (As read here:)如果我通過MainMenu.xib(xcode中的側邊菜單)中的複選框使NSbuttonCell透明,我可以使它透明。通過一個按鈕鏈接到一些代碼,我可以使它重新出現。這是我的問題,我不能讓它再次消失。Applescript可可應用程序NSButtonCell不設置單元格透明

目前有告訴我的單選按鈕姓名(名稱),然後這個按鈕動作試圖將其關閉

on buttonPress_(sender) 
     set tempVar to codeOptionMatrix's cellAtRow_column_(1,0) -- variable to target correct NSbuttoncell 
     log title of tempVar -- tell me the name of that cell so I know I got the right one 
     tempVar's setTransparent_(true) -- make transparent 
end buttonPress_ 

正如我提到的,如果我把它透明通過在Xcode側菜單和設置相同按鈕操作爲「setTransparent_(false)」,它將重新出現。任何人都有網站內的任何內容,爲什麼我沒有得到任何的錯誤,但沒有把它變成透明的。

回答

0

似乎被鏈接到啓用的元素。以下對我有用。

on buttonPress_(sender) 
     set tempVar to codeOptionMatrix's cellAtRow_column_(1,0) -- variable to target correct NSbuttoncell 
     log title of tempVar -- tell me the name of that cell so I know I got the right one 
     set enabled of tempVar to false 
     tempVar's setTransparent_(true) -- make transparent 
end buttonPress_ 
相關問題