当前位置: 首页>>代码示例>>Python>>正文


Python NSColor.yellowColor方法代码示例

本文整理汇总了Python中AppKit.NSColor.yellowColor方法的典型用法代码示例。如果您正苦于以下问题:Python NSColor.yellowColor方法的具体用法?Python NSColor.yellowColor怎么用?Python NSColor.yellowColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppKit.NSColor的用法示例。


在下文中一共展示了NSColor.yellowColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drawGlyphIntoBackground

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import yellowColor [as 别名]
def drawGlyphIntoBackground(layer, info):

        # Due to internal Glyphs.app structure, we need to catch and print exceptions
        # of these callback functions with try/except like so:
        try:
        	# Your drawing code here
        	NSColor.yellowColor().set()
        	layer.background.bezierPath.fill()

        # Error. Print exception.
        except:
        	import traceback
        	print traceback.format_exc()
开发者ID:filipenegrao,项目名称:glyphsapp-scripts,代码行数:15,代码来源:change_x_height.py

示例2: __init__

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import yellowColor [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()
开发者ID:behnam,项目名称:typefacet,代码行数:31,代码来源:testAll.py

示例3: Color

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import yellowColor [as 别名]
        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)


class Sound:
    """ A system sound """

    def __init__(self, path):
        self.path = path
        self.ns_sound = None
开发者ID:xoconusco,项目名称:verano16,代码行数:33,代码来源:osx_panel.py

示例4: GSPath

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import yellowColor [as 别名]
coor_x2 = o.width
coor_y1 = half_xh - tolerance
coor_y2 = half_xh + tolerance

# ----------------

newPath = GSPath()
nu_nodes = [(coor_x1, coor_y1), (coor_x1, coor_y2), (coor_x2, coor_y2), (coor_x2, coor_y1)]

for n in nu_nodes:
	newNode = GSNode()
	newNode.type = GSLINE
	newNode.position = n
	newPath.nodes.append(newNode)

newPath.closed = True
background_layer.paths.append(newPath)

NSColor.yellowColor().set()
layer.background.bezierPath.fill()


def glyphs_width():
	node_coor = {}
	for layer in Font.selectedLayers:
		glyph = layer.parent
		gname = glyph.name
		node_coor[gname] = font.glyphs[gname].layers[0].width
	return node_coor

Glyphs.addCallback(drawGlyphIntoBackground, DRAWBACKGROUND)
开发者ID:filipenegrao,项目名称:glyphsapp-scripts,代码行数:33,代码来源:change_x_height.py


注:本文中的AppKit.NSColor.yellowColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。