FROM : Bus Mini
DATE : Sat Jul 08 16:44:33 2006
I did connect *IBOutlet NSWindow *myWindow *to the window which was created
in nib.
and the followed code is the exactly method was called when a button was
cilcked
- (IBAction)startToWork:(id)sender
{
[myWindow makeKeyAndOrderFront:self];
}
It doesn't work.
And I know another way to pop up a window, but It is not so good, I just
pose this to list to ask an easy way.
- (IBAction)startToWork:(id)sender
{
NSRect screenRect = [[NSScreen mainScreen] visibleFrame];
newWindow = [[NSWindow alloc] initWithContentRect:screenRect
styleMask:
NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask
backing:NSBackingStoreBuffered
defer:NO screen:[NSScreen mainScreen]];//notice that newWindow
is not an outlet
[myWindow setFrame: screenRect display:YES];
[newWindow setContentView:[myWindow contentView]];//add myWindow to
newWindow
[newWindow makeKeyAndOrderFront:nil];
}
Thanks for you advice, could you give me an example?
--
Yours sincerely
Mini Bus.
DATE : Sat Jul 08 16:44:33 2006
I did connect *IBOutlet NSWindow *myWindow *to the window which was created
in nib.
and the followed code is the exactly method was called when a button was
cilcked
- (IBAction)startToWork:(id)sender
{
[myWindow makeKeyAndOrderFront:self];
}
It doesn't work.
And I know another way to pop up a window, but It is not so good, I just
pose this to list to ask an easy way.
- (IBAction)startToWork:(id)sender
{
NSRect screenRect = [[NSScreen mainScreen] visibleFrame];
newWindow = [[NSWindow alloc] initWithContentRect:screenRect
styleMask:
NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask
backing:NSBackingStoreBuffered
defer:NO screen:[NSScreen mainScreen]];//notice that newWindow
is not an outlet
[myWindow setFrame: screenRect display:YES];
[newWindow setContentView:[myWindow contentView]];//add myWindow to
newWindow
[newWindow makeKeyAndOrderFront:nil];
}
Thanks for you advice, could you give me an example?
--
Yours sincerely
Mini Bus.
| Related mails | Author | Date |
|---|---|---|
| Bus Mini | Jul 7, 19:25 | |
| Uli Kusterer | Jul 7, 20:33 | |
| Bus Mini | Jul 8, 06:26 | |
| Uli Kusterer | Jul 8, 12:41 | |
| Bus Mini | Jul 8, 16:44 | |
| I. Savant | Jul 8, 17:33 | |
| Bus Mini | Jul 8, 17:53 | |
| Shawn Erickson | Jul 8, 18:27 | |
| Uli Kusterer | Jul 8, 21:25 | |
| Bus Mini | Jul 9, 16:33 |






Cocoa mail archive

