Skip to content

Instantly share code, notes, and snippets.

View justingraves's full-sized avatar

Justin Graves justingraves

  • Infegy, Inc.
  • Kansas City, MO, USA
View GitHub Profile
/*
* AppController.j
* Social Radar
*
* Created by You on April 25, 2010.
* Copyright 2010, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPTabView.j>
@import <AppKit/CPToolbar.j>
@implementation SRRibbon : CPToolbar
{
}
- (id)initWithIdentifier:(CPString)anIdentifier
{
if (self = [super initWithIdentifier:anIdentifier])
- (void)drawRect:(CPRect)aRect
{
if(needsLayout)
{
[self layoutSubviews];
needsLayout = NO;
}
[super drawRect:aRect];
var start = [[CPDate alloc] init];
@justingraves
justingraves / gist:180177
Created September 3, 2009 08:18
A little rounded black tooltip you can easily point at stuff
/*
* CPTooltip.j
* Makes a little black rounded-rect gradient tooltip with some text (can have multiple lines with \n) which points at something.
* Usage example:
* tooltip = [[CPTooltip alloc] initWithText:@"Hello There" atPoint:CPPointMake(100,100)];
* [self addSubview:tooltip];
*
* The above will make a tooltip that says "Hello There" which is pointing at this view's 100x100 point.
* If the tooltip is too close to its superview's edges, it will adjust itself to maintain readability.
*