Skip to content

Instantly share code, notes, and snippets.

@katsuhide
Created June 29, 2013 14:26
Show Gist options
  • Save katsuhide/5891302 to your computer and use it in GitHub Desktop.
Save katsuhide/5891302 to your computer and use it in GitHub Desktop.
UI周り
// Comboboxを初期化
[_directoryField selectItemAtIndex:0];
// Comboboxの選択されているindexを取得
[_directoryField indexOfSelectedItem]
// NSWidowを半透明に(0.0 ~ 1.0)
[_window setAlphaValue:1.0];
// 背景を設定
NSColor *color = [NSColor colorWithCalibratedRed:0.99 green:0.99 blue:0.99 alpha:0.99];
[_window setBackgroundColor:color];
// フェードアウトでの切り替え
- (void)showWindow:(id)sender
{
[_window orderFront:nil];
NSMutableDictionary* dict = [NSMutableDictionary dictionary];
[dict setObject:_window forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeOutEffect forKey:NSViewAnimationEffectKey];
NSViewAnimation *anim = [[NSViewAnimation alloc]
initWithViewAnimations:[NSArray arrayWithObject:dict]];
[anim setDuration:1];
[anim setAnimationCurve:NSAnimationEaseIn];
[anim startAnimation];
[anim release];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment