• 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
centering view in nstabviewitem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

centering view in nstabviewitem


  • Subject: centering view in nstabviewitem
  • From: anonymous user <email@hidden>
  • Date: Mon, 27 Jun 2005 03:22:21 -0700

Hi all. I'm having trouble centering a custom view within a
NSTabViewItem.   Here's my hacked up method where I'm dynamically
creating the tabs:

-(void)awakeFromNib
{
   NSMutableDictionary * mods;
   NSEnumerator *enumerator;
   NSString * key;

   register_modules();

   mods = guimod_getdict();
   enumerator = [ mods keyEnumerator ];

   while(( key = [enumerator nextObject] ) )
   {
      TestView * viewobj;
      NSTabViewItem * tabitem;

      viewobj = [ mods objectForKey: key ];

      tabitem = [[NSTabViewItem alloc] initWithIdentifier: key ];

      NSView * view = [ viewobj getView ];

      unsigned mask = NSViewMaxYMargin | NSViewMaxXMargin |
                                      NSViewMinYMargin  | NSViewMinXMargin ;

     [ view setAutoresizingMask: mask ];
     [ tabitem setLabel: key ];

     [ [ tabitem view ] addSubview: view ];
     [ tabView addTabViewItem: tabitem ];
   }
}


[ viewobj getView ] returns an NSView created with Interface Builder
and loaded from a nib file.

Here's two examples of the view's by themselves, and inserted in the tab:

http://sometimesi.servebeer.com/sshots/standalone.jpg
http://sometimesi.servebeer.com/sshots/newintabview.jpg

http://sometimesi.servebeer.com/sshots/freqstandalone.jpg
http://sometimesi.servebeer.com/sshots/freqintabview.jpg

Can somebody point out where I'm going wrong, or give some suggestions
as to how to do this correctly?

Thanks for your time.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: How to find the manual (or at least the header)
  • Next by Date: easy way to refresh branch of NSOutlineView
  • Previous by thread: Re: Dashboard + RSS
  • Next by thread: easy way to refresh branch of NSOutlineView
  • Index(es):
    • Date
    • Thread