Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
"Create a Windows 7 install disk" winks360 Windows, Linux & Others on the Mac 19 Aug 22, 2012 03:47 PM
Watch best sporting actions and players in one touch- iPhone. s.dasaraddi iPhone and iPod touch Apps 0 Feb 21, 2011 11:14 PM
Your holiday gift problems solved! Steve Jobs action figure Blue Velvet Community Discussion 31 Nov 23, 2010 11:45 PM
Aliens Attacking the Earth! Check out the newest iPhone action game! developer.ost iPhone and iPod touch Apps 0 Nov 8, 2010 05:57 AM
Folder Actions and iTunes... th3g00ds0n Mac Programming 0 Jan 13, 2010 02:18 PM


All times are GMT -5. The time now is 04:47 AM.

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

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