Logo ROOT   6.18/05
Reference Guide
ROOTApplicationDelegate.mm
Go to the documentation of this file.
2#include "TApplication.h"
3
4@implementation ROOTApplicationDelegate
5
6//______________________________________________________________________________
7- (id) init
8{
9 if (self = [super init])
10 [[NSApplication sharedApplication] setDelegate : self];
11
12 return self;
13}
14
15//______________________________________________________________________________
16- (void) dealloc
17{
18 [NSApp setDelegate : nil];//?
19 [super dealloc];
20}
21
22
23//NSApplicationDelegate.
24
25//______________________________________________________________________________
26- (void) applicationWillResignActive : (NSNotification *) aNotification
27{
28 //Popup windows, menus, color-selectors, etc. - they all have
29 //a problem: due to some reason, Cocoa changes the z-stack order
30 //of such a window while switching between applications (using alt-tab, for example).
31 //This leads to a very annoying effect: you open a menu, alt-tab,
32 //alt-tab back and ... popup or menu is now behind the main window.
33 //I have to save/restore this z-stack order here.
34
35 //Popups were fixed using transient hint, noop now
36#pragma unused(aNotification)
37}
38
39//______________________________________________________________________________
40- (void) applicationDidBecomeActive : (NSNotification *) aNotification
41{
42 //Popup windows, menus, color-selectors, etc. - they all have
43 //a problem: due to some reason, Cocoa changes the z-stack order
44 //of such a window while switching between applications (using alt-tab, for example).
45 //This leads to a very annoying effect: you open a menu, alt-tab,
46 //alt-tab back and ... popup or menu is now behind the main window.
47 //I have to save/restore this z-stack order here.
48
49 //Popups were fixed using transient hint, noop now.
50#pragma unused(aNotification)
51}
52
53//______________________________________________________________________________
54- (void) quitROOT
55{
57}
58
59//______________________________________________________________________________
60- (NSApplicationTerminateReply) applicationShouldTerminate : (NSApplication *) sender
61{
62#pragma unused(sender)
63 [self performSelector : @selector(quitROOT) withObject : nil afterDelay : 0.1];
64 return NSTerminateCancel;
65}
66
67@end
static Int_t init()
R__EXTERN TApplication * gApplication
Definition: TApplication.h:165
XFontStruct * id
Definition: TGX11.cxx:108
typedef void((*Func_t)())
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...