Пример #1
0
class SMSSplitView(NSSplitView):
    text = None
    attributes = NSDictionary.dictionaryWithObjectsAndKeys_(
        NSFont.systemFontOfSize_(NSFont.labelFontSize() - 1),
        NSFontAttributeName, NSColor.darkGrayColor(),
        NSForegroundColorAttributeName)

    def setText_(self, text):
        self.text = NSString.stringWithString_(text)
        self.setNeedsDisplay_(True)

    def dividerThickness(self):
        return NSFont.labelFontSize() + 1

    def drawDividerInRect_(self, rect):
        NSSplitView.drawDividerInRect_(self, rect)
        if self.text:
            point = NSMakePoint(
                NSMaxX(rect) -
                self.text.sizeWithAttributes_(self.attributes).width - 10,
                rect.origin.y)
            self.text.drawAtPoint_withAttributes_(point, self.attributes)