-
Notifications
You must be signed in to change notification settings - Fork 1
/
SplashWindowController.m
71 lines (59 loc) · 1.96 KB
/
SplashWindowController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// SplashWindowController.m
// Add Folder Icons
//
// Created by Andrew Hodgkinson on 26/05/2012.
// Copyright 2012 Hipposoft. All rights reserved.
//
#import "SplashWindowController.h"
@implementation SplashWindowController
/******************************************************************************\
* -initWithWindowNibName:
*
* Upon initialisation, this controller will open its window, put it at the
* front of the normal stack and make it the key window. It is the caller's
* responsibility to check that the value of the "showSplashScreenAtStartup"
* preferences key is not 'NO' and only create an instance if so.
*
* In: ( NSString * ) windowNibName
* Name of the NIB containing this controller's window.
*
* Out: ( id )
* This instance ("self").
\******************************************************************************/
- ( instancetype ) initWithWindowNibName: ( NSString * ) windowNibName
{
if ( ( self = [ super initWithWindowNibName: windowNibName ] ) )
{
/* Invoke 'window' to prompt lazy-load of the window, leading to
* (amongst other things) '-windowDidLoad' being called.
*/
[ self window ];
}
return self;
}
/******************************************************************************\
* -windowDidLoad:
*
* The window loaded - open it in a centred position.
\******************************************************************************/
- ( void ) windowDidLoad
{
[ super windowDidLoad ];
[ [ self window ] center ];
[ [ self window ] makeKeyAndOrderFront: nil ];
}
/******************************************************************************\
* -closeWindow:
*
* Close the window.
*
* In: ( NSButton * ) sender
* The button used to send this action message (ignored).
\******************************************************************************/
- ( IBAction ) closeWindow: ( NSButton * ) sender
{
( void ) sender;
[ self close ];
}
@end