Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.c
changeset 725:4d4018e8eeb8
prev718:047a244936d1
next736:a02d1475ccfd
author nkeynes
date Sun Jul 06 03:18:55 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Add slightly more detailed about dialog
Add (currently empty) preferences dialog (WIP)
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoaui.c Mon Jun 30 04:58:26 2008 +0000
1.2 +++ b/src/cocoaui/cocoaui.c Sun Jul 06 03:18:55 2008 +0000
1.3 @@ -3,7 +3,7 @@
1.4 *
1.5 * Core Cocoa-based user interface
1.6 *
1.7 - * Copyright (c) 2005 Nathan Keynes.
1.8 + * Copyright (c) 2008 Nathan Keynes.
1.9 *
1.10 * This program is free software; you can redistribute it and/or modify
1.11 * it under the terms of the GNU General Public License as published by
1.12 @@ -67,10 +67,13 @@
1.13
1.14 /* Add menu items */
1.15 title = [@"About " stringByAppendingString:appName];
1.16 - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
1.17 + [appleMenu addItemWithTitle:title action:@selector(about_action:) keyEquivalent:@""];
1.18 +
1.19 +// [appleMenu addItem:[NSMenuItem separatorItem]];
1.20 +// [appleMenu addItemWithTitle: NS_("Preferences...") action:@selector(preferences_action:) keyEquivalent:@","];
1.21 +
1.22 + // Services Menu
1.23 [appleMenu addItem:[NSMenuItem separatorItem]];
1.24 -
1.25 - // Services Menu
1.26 services = [[[NSMenu alloc] init] autorelease];
1.27 [appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""];
1.28 [appleMenu setSubmenu: services forItem: [appleMenu itemWithTitle: @"Services"]];
1.29 @@ -145,6 +148,20 @@
1.30 cocoa_gui_run_later();
1.31 }
1.32 }
1.33 +- (void) about_action: (id)sender
1.34 +{
1.35 + NSArray *keys = [NSArray arrayWithObjects: @"Version", @"Copyright", nil];
1.36 + NSArray *values = [NSArray arrayWithObjects: @APP_VERSION, @"Copyright (C) 2005-2008 Nathan Keynes", nil];
1.37 +
1.38 + NSDictionary *options= [NSDictionary dictionaryWithObjects: values forKeys: keys];
1.39 +
1.40 + [NSApp orderFrontStandardAboutPanelWithOptions: options];
1.41 +}
1.42 +- (void) preferences_action: (id)sender
1.43 +{
1.44 + LxdreamPrefsPanel *panel = [[LxdreamPrefsPanel alloc] initWithContentRect: NSMakeRect(0,0,600,400)];
1.45 + [NSApp runModalForWindow: panel];
1.46 +}
1.47 - (void) load_action: (id)sender
1.48 {
1.49 NSOpenPanel *panel = [NSOpenPanel openPanel];
1.50 @@ -238,6 +255,7 @@
1.51 [NSApp setDelegate: delegate];
1.52 NSString *iconFile = [[NSBundle mainBundle] pathForResource:@"dcemu" ofType:@"gif"];
1.53 NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile: iconFile];
1.54 + [iconImage setName: @"NSApplicationIcon"];
1.55 [NSApp setApplicationIconImage: iconImage];
1.56 cocoa_gui_create_menu();
1.57 NSWindow *window = cocoa_gui_create_main_window();
.