Re: Re: Status Bar
Re: Re: Status Bar
- Subject: Re: Re: Status Bar
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 12 Dec 2001 08:39:08 -0500
This will work fine, but there is a caveat.
The easiest way to set up the status bar is to have put it into the NIB
file along with the rest of the UI. Implement -awakeFromNib in the File's
Owner (or app delegate), and remove the status bar from the superview, if
it shouldnt' be visible upon the first show of the window. Make the
window non-deferred and not visible at load if you need to manipulate the
view hierarchy prior to first display-- this will ensure that the user
doesn't see the manipulations "as they happen".
Caveat: Outlets are not retained.
Most likely, you will have an outlet that is connected to the status bar
view. The outlet will be a weak reference to the status bar view.
-removeFromSuperview will cause -release to be called as the status bar is
removed from the superview's array of subviews.
Make sure you invoke -retain prior to removing the status bar from the
superview. Doing so in -awakeFromNib is likely the most
convenient/sensible place to do so.
Depending on your controller model, the matching -release could be placed
in either the -dealloc method or the -windowWillClose: delegate method.
b.bum
On Wednesday, December 12, 2001, at 01:15 AM, cocoa-dev-
email@hidden wrote:
If you mean, "how is a view like the Finder's status bar inserted and
removed on demand:"
[mySuperView addSubview:mySubView];
will add it, and
[mySubView removeFromSuperview];
will remove it.
You can animate the addition/removal by iteratively modifying the
subView's height and origin.
b.bum
Do the voices in my head bother you?