FROM : Uli Kusterer
DATE : Sat Jul 08 12:41:37 2006
Am 08.07.2006 um 06:26 schrieb Bus Mini:
> Thanks for you advice. Now suppose I have two windows created in
> nib, one is the main window which was showed when app started,
> another is the one I want it to poped up when I click a button in
> main window.
>
> And the followed code was called when the button was clicked,
>
> IBOutlet NSWindow *myWindow;
You *have* hooked up this outlet in IB, have you?
> .............
> [myWindow showWindows] //this doesn't work
Of course not. myWindow is an NSWindow, showWindows is a method on
NSDocument. It's like telling a skating rink to fly :-S
> [myWindow display] //this doesn't work either
Check out the docs. Display is for redrawing a window that's
already visible, not for actually showing it.
> [myWindow print:self];//this doesn't work either
> [myWindow makeKeyAndOrderFront:nil];//this doesn't work either
These two *should* work.
> Must I set something special?
Do you have a good book on Cocoa? I strongly suggest you get Aaron
Hillegass's "Cocoa Programming for Mac OS X (2nd ed.)". It will walk
you through all the basics.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
DATE : Sat Jul 08 12:41:37 2006
Am 08.07.2006 um 06:26 schrieb Bus Mini:
> Thanks for you advice. Now suppose I have two windows created in
> nib, one is the main window which was showed when app started,
> another is the one I want it to poped up when I click a button in
> main window.
>
> And the followed code was called when the button was clicked,
>
> IBOutlet NSWindow *myWindow;
You *have* hooked up this outlet in IB, have you?
> .............
> [myWindow showWindows] //this doesn't work
Of course not. myWindow is an NSWindow, showWindows is a method on
NSDocument. It's like telling a skating rink to fly :-S
> [myWindow display] //this doesn't work either
Check out the docs. Display is for redrawing a window that's
already visible, not for actually showing it.
> [myWindow print:self];//this doesn't work either
> [myWindow makeKeyAndOrderFront:nil];//this doesn't work either
These two *should* work.
> Must I set something special?
Do you have a good book on Cocoa? I strongly suggest you get Aaron
Hillegass's "Cocoa Programming for Mac OS X (2nd ed.)". It will walk
you through all the basics.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
| 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

