Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 27, 2009, 09:04 PM   #1
silentnosie
macrumors newbie
 
Join Date: May 2009
Actions and windows

For the time being I'm dealing with two separate windows(one is a panel) in Xcode3.

I have one button on the panel window that sends text to a text field on window one. I would like to have the panel close and a new panel open when I push the button, while sending text still.

My controller.h file I have:
Code:
#import <Cocoa/Cocoa.h>

@interface Domaintest : NSObject {
    IBOutlet id display;
	IBOutlet NSPanel* Domain01;
}
- (IBAction)click:(id)sender;
@end
I named the file Domain01 in IB under Identity tab on the Name field not the Class one or anywhere else

For my controller.m file i have:

Code:
#import "Domaintest.h"

@implementation Domaintest
- (IBAction)click:(id)sender {
	[display setStringValue:@"Domain Test"];
   	[Domain01 Close];
 
}
@end
The button is sending the text just fine but it's not closing the window. When I build I get two warning (yellow color) that NSPanel may bot respond to '-Close'.

Anybody have any suggestion on how to fix or do this another way?
silentnosie is offline   0 Reply With Quote
Old May 28, 2009, 10:48 AM   #2
larkost
macrumors 6502a
 
Join Date: Oct 2007
The behavior you want from NSWindow is '-close'. Objective-C (like C) is case-sensitive, so '-close' and '-Close' are different things.
larkost is offline   0 Reply With Quote
Old May 28, 2009, 12:42 PM   #3
silentnosie
Thread Starter
macrumors newbie
 
Join Date: May 2009
stuff

Okay I changed Close to close, it's sending the text still, but the panel window refuses to close.
silentnosie is offline   0 Reply With Quote
Old May 29, 2009, 01:12 PM   #4
silentnosie
Thread Starter
macrumors newbie
 
Join Date: May 2009
stuff

cool beans man, got it to work. I started at test project and forgot to rename the panel to Domain01.

What would I use to get another window opened

Code:
#import "tester.h"

@implementation tester
- (IBAction)click:(id)sender {
	[display setStringValue:@"Domain Test"];
   	[Domain01 close];
	[Domain02 open];
}
@end
sorry been a few years since I did any type of programing and some stuff I just don't remember or never tried
silentnosie is offline   0 Reply With Quote
Old May 29, 2009, 01:23 PM   #5
silentnosie
Thread Starter
macrumors newbie
 
Join Date: May 2009
stuff

lol well this came back to me also right after I posted.

Got it working with
Code:
#import "tester.h"

@implementation tester
- (IBAction)click:(id)sender {
	[display setStringValue:@"Domain Test"];
   	[Domain01 close];
	[Domain02 orderFront:self];
}
@end
man I never thought I would forget this crap, but it's coming back slowly. Thanks again for your help man.
silentnosie is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Wishes, Punishments, Mottos, Actions intelmarket1 iPhone and iPod touch Apps 0 Apr 24, 2014 02:36 AM
Creating a program to perform certain actions lparpis Mac Programming 1 Feb 19, 2013 11:07 AM
Finder Freezing During Network Actions- Help legaleye3000 OS X 5 Jan 20, 2013 09:59 AM
XCode 4.4 and IBOutlets+Actions Meldar Mac Programming 14 Sep 7, 2012 01:32 PM

Forum Jump

All times are GMT -5. The time now is 07:53 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC