本文整理汇总了Python中AppKit.NSColor.greenColor方法的典型用法代码示例。如果您正苦于以下问题:Python NSColor.greenColor方法的具体用法?Python NSColor.greenColor怎么用?Python NSColor.greenColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppKit.NSColor
的用法示例。
在下文中一共展示了NSColor.greenColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import greenColor [as 别名]
def __init__(self, drawGrid=False):
self.w = Window((600, 500), "", minSize=(300, 250))
grp = Group((0, 0, 0, 0))
grp.button = Button((10, 10, -10, 20), "Toggle", self.buttonCallback)
self.view1 = TestSplitSubview((0, 0, 0, 0), NSColor.redColor())
paneDescriptions2 = [
dict(view=self.view1, canCollapse=True, size=50, identifier="pane1"),
dict(view=grp, identifier="pane2"),
dict(view=TestSplitSubview((0, 0, 0, 0), NSColor.greenColor()), minSize=50, identifier="pane3"),
dict(view=TestSplitSubview((0, 0, 0, 0), NSColor.yellowColor()), identifier="pane4"),
]
self.nestedSplit = SplitView((0, 0, 0, 0), paneDescriptions2, isVertical=True)
paneDescriptions1 = [
dict(view=self.nestedSplit, identifier="pane5"),
dict(
view=TestSplitSubview((0, 0, 0, 0), NSColor.magentaColor()),
minSize=100,
size=100,
canCollapse=True,
identifier="pane6",
),
]
self.w.splitView = SplitView((10, 10, -10, -10), paneDescriptions1, isVertical=False)
if drawGrid:
self.drawGrid()
self.w.open()
示例2: linearGradient
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import greenColor [as 别名]
def linearGradient(startPoint=None, endPoint=None, colors=None, locations=None):
global currentGradient
global currentFillColor
if colors is None:
colors = [NSColor.greenColor(), NSColor.redColor()]
if locations is None:
locations = [i / float(len(colors)-1) for i in range(len(colors))]
currentGradient = ("linear", startPoint, endPoint, colors, locations)
currentFillColor = None
示例3: check_signature_matcher
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import greenColor [as 别名]
def check_signature_matcher(self, obj):
regex = obj.stringValue()
feedback = self.customSignatureMatcherFeedback
try:
re.compile(regex)
feedback.setColor_(NSColor.greenColor())
feedback.setToolTip_("")
except re.error, e:
feedback.setColor_(NSColor.redColor())
feedback.setToolTip_(str(e))
示例4: transformedValue_
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import greenColor [as 别名]
def transformedValue_(self, priority):
if priority > 4:
return NSColor.redColor()
elif priority > 3:
return NSColor.orangeColor()
elif priority > 2:
return NSColor.blueColor()
elif priority > 1:
return NSColor.greenColor()
elif priority > 0:
return NSColor.brownColor()
else:
return NSColor.blackColor()
示例5: __init__
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import greenColor [as 别名]
class Color:
""" A class representing a color """
def __init__(self, ns_color):
self.ns_color = ns_color
Color.BLACK = Color(NSColor.blackColor())
Color.BLUE = Color(NSColor.blueColor())
Color.BROWN = Color(NSColor.brownColor())
Color.CYAN = Color(NSColor.cyanColor())
Color.DARK_GRAY = Color(NSColor.darkGrayColor())
Color.GRAY = Color(NSColor.grayColor())
Color.GREEN = Color(NSColor.greenColor())
Color.MAGENTA = Color(NSColor.magentaColor())
Color.ORANGE = Color(NSColor.orangeColor())
Color.PURPLE = Color(NSColor.purpleColor())
Color.RED = Color(NSColor.redColor())
Color.WHITE = Color(NSColor.whiteColor())
Color.YELLOW = Color(NSColor.yellowColor())
class Font:
""" Text font """
def __init__(self, name, size):
self.ns_font = NSFont.fontWithName_size_(name, size)