centering view in nstabviewitem
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