Reputation: 3804
I have a main appl. window with a toolbar. When user clicks on button X I want to open a small input window that is floating, and is "attached" to the bottom of the main window's toolbar (it should move with the main window until user closes the panel). So, if I use a panel, how do I make it "stick" to the bottom of the main toolbar?
Edited:
Ok, since I am creating windows in IB, I have a class set up that is supposed to turn a panel into a child. It doesn't work, however. I get an error in the .m class: Expected identifier or '('
Why?
@interface myClass : NSObject {
IBOutlet NSWindow *myWin;
IBOutlet NSPanel *myPan;
}
@end
@implementation myClass
[myWin addChildWindow:myPan ordered:NSWindowAbove];
@end
Upvotes: 1
Views: 1582
Reputation: 46020
Make the panel a child window of the main window by calling:
[mainWindow addChildWindow:yourPanel ordered:NSWindowAbove];
This will make the child window follow the main window when the main window is moved.
Upvotes: 2
Reputation: 508
You shall use the layout positionning in the inspector. Just make sure that sub-view is at fixed distance from bottom and others are elastic.
Upvotes: -1