Created
October 8, 2008 20:23
-
-
Save nickjs/15574 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LEAlert(string) | |
{ | |
var alertWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0,0,300,150) styleMask:CPHUDBackgroundWindowMask | CPClosableWindowMask]; | |
[alertWindow center]; | |
[alertWindow setTitle:LEL.alertWindowTitle]; | |
var content = [alertWindow contentView]; | |
var text = [LELabel labelWithStringValue:string]; | |
[text setTextColor:[CPColor whiteColor]]; | |
[text setFont:[CPFont systemFontOfSize:16.0]]; | |
[text setAlignment:CPCenterTextAlignment]; | |
[text setLineBreakMode:CPLineBreakByWordWrapping]; | |
[text setFrame:CGRectMake(10,0,CGRectGetWidth([content bounds])-20,80)]; | |
var ok = [[CPButton alloc] initWithFrame:CGRectMake(CGRectGetWidth([content bounds])-60,CGRectGetHeight([content bounds])-30,50,20)]; | |
[ok setBezelStyle:CPHUDBezelStyle]; | |
[ok setTitle:LEL.ok]; | |
[ok setTarget:alertWindow]; | |
[ok setAction:@selector(performClose:)]; | |
[content addSubview:text]; | |
[content addSubview:ok]; | |
[alertWindow orderFront:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment