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

Re: Disappearing programmatic NSTextView in tab when setting autoresizingmask


  • Subject: Re: Disappearing programmatic NSTextView in tab when setting autoresizingmask
  • From: James DiPalma <email@hidden>
  • Date: Wed, 16 Jun 2004 12:20:09 -0700

On Jun 15, 2004, at 6:54 PM, Barrett Conrad wrote:
// THIS MAKES myTextView DISAPPEAR
[myTextView setAutoresizingMask: NSViewMaxXMargin | NSViewMinYMargin];

When this line of code is removed/commented does your text view show up? I'm a little unclear about what is happening because your code does not resize your tab view, so when would an autoresizing mask be used?

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.

Your auto resizing mask looks correct.

The tabFrame parameter has these values:

MinX = 20.000000
MaxX = 632.000000
MinY = 163.000000
MaxY = 533.000000

An NSRect does not have any of these parameters. Its been about 4 years since I looked at Carbon, but I remember their rects being something like that. Since this is a Cocoa mailing list and this is Cocoa based code, it might make sense to list your rects using Cocoa based values. Try:

NSLog(@"tabFrame %@", NSStringFromRect(tabFrame));

It looks like you understand that NSMakeRect takes x, y, width, height, but I feel uncomfortable with understanding what is going on because I don't know where these tabFrame values came from. You may also want to print out your text view's frame to see where it is before it is added.

Your call to tab view's initWithFrame: method includes a frame that should be within your view's bounds (I had suspected that you may have accidently used a frame when you should be using a bounds, but your NSMakeRect is within your bounds).

-(id)initWithTabFrame:(NSRect)tabFrame {

I can't find any code that uses initWithTabFrame:, can you mention what class this method is in and how and where this method is called.

[self addSubview:myTextView];

It looks like you are an NSView subclass.

self = [super init];

NSView's designated initializer is initWithFrame:. I don't know what happens when initializing a view through init, but it is likely to have a zeroed out frame.

Any thoughts?

A few suggestions about where to look, but I don't know what is happening. Good luck,



-jim
_______________________________________________
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.


References: 
 >Disappearing programmatic NSTextView in tab when setting autoresizingmask (From: Barrett Conrad <email@hidden>)

  • Prev by Date: Re: [newbie] numeric strings
  • Next by Date: Re: Locking
  • Previous by thread: Disappearing programmatic NSTextView in tab when setting autoresizingmask
  • Next by thread: Controlling targets and headers?
  • Index(es):
    • Date
    • Thread