• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checking when tabs are selected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Checking when tabs are selected (From: Chad Armstrong <email@hidden>)

  • Prev by Date: Re: CDEF's in Cocoa
  • Next by Date: [ANN] Beta Testers For New Cocoa App
  • Previous by thread: Checking when tabs are selected
  • Next by thread: Re: Checking when tabs are selected
  • Index(es):
    • Date
    • Thread