mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 12:01:16 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@17643 72102866-910b-0410-8b05-ffd578937521
56 lines
1.1 KiB
Objective-C
56 lines
1.1 KiB
Objective-C
// Author: Andrew E. Ruder
|
|
// Copyright (C) 2003 by Free Software Foundation, Inc
|
|
|
|
#include "GormSetNameController.h"
|
|
|
|
#include <AppKit/NSApplication.h>
|
|
#include <AppKit/NSButton.h>
|
|
#include <AppKit/NSTextField.h>
|
|
#include <AppKit/NSPanel.h>
|
|
#include <AppKit/NSNibLoading.h>
|
|
#include <AppKit/NSPanel.h>
|
|
|
|
@implementation GormSetNameController : NSObject
|
|
- (void)dealloc
|
|
{
|
|
RELEASE(window);
|
|
RELEASE(textField);
|
|
RELEASE(okButton);
|
|
RELEASE(cancelButton);
|
|
|
|
[super dealloc];
|
|
}
|
|
- (int)runAsModal
|
|
{
|
|
int result;
|
|
|
|
if (!window)
|
|
{
|
|
if (![NSBundle loadNibNamed: @"GormSetName" owner: self])
|
|
{
|
|
return NSAlertAlternateReturn;
|
|
}
|
|
}
|
|
|
|
[window makeKeyAndOrderFront: nil];
|
|
[window makeFirstResponder: textField];
|
|
|
|
result = [NSApp runModalForWindow: window];
|
|
|
|
return result;
|
|
}
|
|
- (NSTextField *) textField
|
|
{
|
|
return textField;
|
|
}
|
|
- (void) cancelHit: (id)sender
|
|
{
|
|
[window close];
|
|
[NSApp stopModalWithCode: NSAlertAlternateReturn];
|
|
}
|
|
- (void) okHit: (id)sender
|
|
{
|
|
[window close];
|
|
[NSApp stopModalWithCode: NSAlertDefaultReturn];
|
|
}
|
|
@end
|