Disappearing programmatic NSTextView in tab when setting autoresizingmask
Disappearing programmatic NSTextView in tab when setting autoresizingmask
- Subject: Disappearing programmatic NSTextView in tab when setting autoresizingmask
- From: Barrett Conrad <email@hidden>
- Date: Tue, 15 Jun 2004 20:54:55 -0500
Hi all.
I am trying to do a proof-of-concept of an app before I attempt it in
ernest; the app will have a dynamic number of tab views that contain a
variable number of NSTextViews within each tabview. I have had no
problems with the tabs or the views contained in them, but I have run
into a problem with locking NSTextViews into place programmatically. I
want the NSTextView to be held in the upper-left corner of the view,
i.e. springy on the right and bottom. When I try to do this, my
NSTextView disappears. The problem seems to be with using
NSViewMinYMargin. Here is the code:
-(id)initWithTabFrame:(NSRect)tabFrame {
self = [super init];
myTextView = [[NSTextView alloc]
initWithFrame:NSMakeRect(0,NSHeight(tabFrame)-66,NSWidth(tabFrame)
-100,20)];
[myTextView setMinSize:NSMakeSize(0.0,20)];
[myTextView setMaxSize:NSMakeSize(300, 20)];
[[myTextView textStorage]
setAttributedString:[[NSAttributedString alloc]
initWithString:@"fubar"]];
[myTextView setEditable:YES];
[myTextView setSelectable:YES];
// THIS MAKES myTextView DISAPPEAR
[myTextView setAutoresizingMask: NSViewMaxXMargin | NSViewMinYMargin];
[self addSubview:myTextView];
return self;
}
The tabFrame parameter has these values:
MinX = 20.000000
MaxX = 632.000000
MinY = 163.000000
MaxY = 533.000000
Any thoughts?
Thanks,
Barrett.
_______________________________________________
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.