 |
 |
Question on Window orderOut (/ handling windows)
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Amstelveen, Netherlands
Status:
Offline
|
|
Basically my question is:
How can you address a specific window with the orderOut, makeKeyAndOrderFront in Cocoa?
The detailed situation is as follows:
I have a panel named "panel" on the left side, a "mainWindow1" in the center. And depending on the userīs input I want to create 1 to 4 "userpanels#" with a tiff or jpeg image in each of them under the mainWindow1.
Now my problem is. When a user presses a button in the "mainWindow1" this mainWindow1 should be ordered out and another window: "mainWindow2" should appear in itīs place. Also at the same time the "userpanels#" should disappear from screen and one of the four panels returns left of the middle (preferably in a slightly larger size).
From the panel it should be possible to restore the old situation again (but if I know it for the first method then this will be just the same).
I already created an outlet: -IBOutlet and hooked it up to the 1 windowcontroller I have. However I am unable to define the right action.
I have no clue on how to address a specific window to disappear or another to makeKeyAndOrderFront.
I read about windowNumber, but that only gives the window number of the window list. I still then donīt know if I have the right window.
But how can you address these particular windows?
Or do I need to create a windowController class for each window and connect the controller to that window only?
What does the -(void)setWindowController actually do? there is no subscription yet. :-(
Please give the function arguments required and in which (windowController) files they should be.
Thanks heaps.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
You have outlets to the window so you can just do something like:
[outletName makeKeyAndOrderFront:nil];
and your window will appear and be key. Same thing for orderOut.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Amstelveen, Netherlands
Status:
Offline
|
|
Thanks, I got it to work.
I have a follow up question.
How exactly do I have to type the function call or message
to be able to have an implementation file A first call a window
controller B, so that this window controller B is the one who
orders the window to the back and front?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
You just do something like:
[windowController showWindow:nil];
in order to show it. If you want to make it disappear fron the screen without closing it then I guess that you'll have to call:
[[windowController window] orderOut:nil];
But if you want to close it you can use the close method in NSWindowController.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |