• 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
dynamic TextView/TextContainer resizing.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dynamic TextView/TextContainer resizing.


  • Subject: dynamic TextView/TextContainer resizing.
  • From: David Harper <email@hidden>
  • Date: Fri, 15 Jul 2005 11:49:09 -0400

Hey everybody,

I'm glad I found this list, it looks like an excellent source of information.

I've been developing exclusively for the mac for many years now, and most of my work has been with what's now considered carbon/c++. I consider myself a beginner when it comes to cocoa, so I'm sure I'll be able to learn a lot from this list. Also, I apologize in advance for some of the dumb questions I'm sure to ask.


The problem I'm having is outlined in the subject line:

In my application's main window, there is an NSView subclass which is used for geometry drawing. I set this view to the window's delegate so that I can maintain that the view fills the left half of the window:

- (IBAction)windowDidResize:(NSNotification *)aNotification
{
    NSRect displayRect = [[self window] frame];
    displayRect.origin.x = 0;
    displayRect.size.width /= 2;
    [self setFrame :displayRect];
    [self setBounds:displayRect];

    [self setNeedsDisplay:YES];
}

I want my TextView to do the same, except with the right half of the window. However, textViews have no apparent setFrame or setBounds methods. Just in case, I tried adding the following code before the setNeedsDisplay call (where engText is the IBOutlet* to my textView subclass) :

    displayRect.origin.x += displayRect.size.width;
    [engText setFrame :displayRect];
    [engText setBounds:displayRect];

Unfortunately, and expectedly, these calls had no effect. Strangely, Xcode compiled the code fine.

Essentially, my question is whether there is a way to achieve what I would like those last 3 lines of code to do. Thanks in advance!

- Dave H.
_______________________________________________
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


  • Follow-Ups:
    • Re: dynamic TextView/TextContainer resizing.
      • From: Troy Stephens <email@hidden>
  • Prev by Date: Font control in TextView, TextStorage?
  • Next by Date: Accessing Hardware Drivers from a Application
  • Previous by thread: Re: Font control in TextView, TextStorage?
  • Next by thread: Re: dynamic TextView/TextContainer resizing.
  • Index(es):
    • Date
    • Thread