Skip to content

Instantly share code, notes, and snippets.

View saikat's full-sized avatar

Saikat Chakrabarti saikat

View GitHub Profile
widgetsCollection = [[CPCollectionView alloc] initWithFrame:bounds];
[widgetsCollection setMinItemSize:CGSizeMake(100, 100)];
[widgetsCollection setMaxItemSize:CGSizeMake(100, 100)];
[widgetsCollection setAutoresizingMask:CPViewWidthSizable];
[widgetsCollection setDelegate:self];
var itemPrototype = [[CPCollectionViewItem alloc] init];
[itemPrototype setView:[[WidgetView alloc] initWithFrame:CGRectMakeZero()]];
for (i = 0; i < [[self subviews] count]; i++) {
[[self subviews][i] removeFromSuperview];
}
[screensCollectionView reloadContent];
var screenName = [[[screensCollectionView items][0] view] screenName];
[screenName setEditable:YES];
[screenName setBackgroundColor:[CPColor whiteColor]];
[[screenName window] makeFirstResponder:screenName];
[screenName selectText:self];
var newScreen = [[ScreenService sharedScreenService] addScreenWithName:"New Screen"];
[screensCollectionView reloadContent];
var index = [[[ScreenService sharedScreenService] screens] count] - 1;
var screenName = [[[screensCollectionView items][index] view] screenName];
[screenName setEditable:YES];
[screenName setBackgroundColor:[CPColor whiteColor]];
[[screenName window] makeFirstResponder:screenName];
[screenName selectText:self];
{
"sources" : [
{
"type" : "git",
"path" : "git://github.com/280north/cappuccino.git",
"parts" : [
{
"src" : "Objective-J",
"dst" : "Frameworks/Objective-J",
"copyFrom" : "Release/Objective-J"
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPView.j>
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPView.j>
// Attempt at a themeable CPTextView
@import <AppKit/CPView.j>
@import <AppKit/CPTextField.j>
// Code extended from code at http://gist.github.com/9848
@implementation CPTextView : CPControl
{
DOMElement FIXME_textArea;
@import <AppKit/CPView.j>
// Code extended from code at http://gist.github.com/9848
@implementation CPTextView : CPView
{
DOMElement FIXME_textArea;
id _delegate;
- (EditableUIView)parentEditableUIView
{
var parentView = [self superview];
while ([parentView class] != [EditableUIView class])
superview = [parentView superview];
return superview;
}