OSX - 如何更改NSButton标题颜色

时间:2016-01-25 13:25:04

标签: objective-c cocoa

我的项目有按钮以及默认标题颜色为黑色的复选框我想将标题颜色更改为红色

1 个答案:

答案 0 :(得分:1)

以下是在控制器中设置按钮标题颜色的代码:

$q = $_REQUEST["q"];

//Read file contents as an array
$lines = file("data.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

//Default output
$suggestions = "No suggestions...";

//If the  file is not empty, try to search lines that contains $q
if(!empty($lines)){

    //Search for $q inside a line, case insensitive
    $results = array_filter($lines, function($line){
        return stripos($line, $q) !== false;
    });
    $suggestions = implode(", ", $results);
}

//Output
echo $suggestions;

可能这就是你想要的。