Created
June 29, 2013 14:26
-
-
Save katsuhide/5891302 to your computer and use it in GitHub Desktop.
UI周り
This file contains hidden or 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
| // 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