• 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
Help with centering custom views in NSTabView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with centering custom views in NSTabView


  • Subject: Help with centering custom views in NSTabView
  • From: anonymous user <email@hidden>
  • Date: Mon, 27 Jun 2005 14:24:03 -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: NSApp with CLI access
  • Next by Date: Re: Return in NSTableView--how detect a row change?
  • Previous by thread: Re: NSApp with CLI access
  • Next by thread: Replacing a method via categorys
  • Index(es):
    • Date
    • Thread