• 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
Disappearing programmatic NSTextView in tab when setting autoresizingmask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Disappearing programmatic NSTextView in tab when setting autoresizingmask
      • From: James DiPalma <email@hidden>
  • Prev by Date: Re: Undo Mysteries
  • Next by Date: Re: option-click hides apps
  • Previous by thread: DVDPlayback framework
  • Next by thread: Re: Disappearing programmatic NSTextView in tab when setting autoresizingmask
  • Index(es):
    • Date
    • Thread