コード例 #1
0
 public static void SetTextColor(this NSButton button, NSColor textColor)
 {
     NSMutableAttributedString attrTitle = new NSMutableAttributedString(button.AttributedTitle);
     NSUInteger len = attrTitle.Length;
     NSRange range = new NSRange(0, len);
     attrTitle.AddAttributeValueRange(NSAttributedString_AppKitAdditions.NSForegroundColorAttributeName, textColor, range);
     attrTitle.FixAttributesInRange(range);
     button.AttributedTitle = attrTitle;
     attrTitle.Release();
 }
コード例 #2
0
ファイル: CropMarker.cs プロジェクト: Monobjc/monobjc-samples
 public void setFillColor(NSColor color)
 {
     this.fillColor.SafeRelease();
     this.fillColor = color;
     this.fillColor.SafeRetain();
 }
コード例 #3
0
ファイル: CropMarker.cs プロジェクト: Monobjc/monobjc-samples
 public void setStrokeColor(NSColor color)
 {
     this.strokeColor.SafeRelease();
     this.strokeColor = color;
     this.strokeColor.SafeRetain();
 }
コード例 #4
0
ファイル: CropMarker.cs プロジェクト: Monobjc/monobjc-samples
 public void setColor(NSColor aColor)
 {
     this.setStrokeColor(aColor);
     this.setFillColor(this.strokeColor.ColorWithAlphaComponent(0.2f));
 }