Re: Checking when tabs are selected
Re: Checking when tabs are selected
- Subject: Re: Checking when tabs are selected
- From: j o a r <email@hidden>
- Date: Tue, 17 Jun 2003 23:19:46 +0200
On Tuesday, Jun 17, 2003, at 22:56 Europe/Stockholm, Chad Armstrong
wrote:
How is it possible to check when an application with several tabs
(NSTabView or NSTabViewItem) have been selected so the application can
respond, such as resizing the window? Do I need to deal with one of
the built in responders?
I see that you have still to discover the wonders of delegates, and
delegate methods! Pure magic, and one of the niceties of Cocoa+ObjC!
Look in the docs for these delegate mehtods:
- tabView:willSelectTabViewItem:
- tabView:didSelectTabViewItem:
If you implement them in your controller object, and set your
controller to be the delegate of the tab view:
[myTabView setDelegate: myController];
...they will get called at the appropriate times.
Also, does anyone have any source code on setFrame:display:animate:
being used? Thanks.
It's dead simple, something like this:
// Get the current frame of the window
NSRect aFrame = [myWindow frame];
// Make frame twice the height, while retaining the title bar position:
aFrame.origin.y -= aFrame.size.height;
aFrame.size.height = (aFrame.size.height * 2);
// Set the modified frame
[myWindow setFrame: aFrame display: YES animate: YES];
j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.