• 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
Subview and window size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subview and window size


  • Subject: Subview and window size
  • From: Kevin Walzer <email@hidden>
  • Date: Fri, 18 Dec 2009 08:14:07 -0500
  • Organization: WordTech Communications LLC

I am trying add a subview to an NSView programatically, and am having some difficulty.

Here's my code:
 DNDView *dropview = [[DNDView alloc] init];
  NSView *view;
  if ([dropview superview] != view) {
    [view addSubview:dropview positioned:NSWindowBelow relativeTo:nil];
  }


NSRect frame = [dropview frame]; NSRect parentframe = [view frame]; frame.size.width = parentframe.size.width; frame.size.height = parentframe.size.height; [dropview setFrame:frame];

  [dropview displayRectIgnoringOpacity:[dropview bounds]]

The *view is supposed to take up the entire window, and my idea is to have the subview do so, as well. However, when I add the subview DNDView (which is supposed to be registered to receive file drags), it does not take up the whole window--it takes up approximately 1/4th of the window.

How can I get the subview to be the same size as its parent view?

Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Subview and window size
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: NSWindow delegate messages question
  • Next by Date: NSArchiver Deprecation
  • Previous by thread: Re: Intercepting events and touches in UIPickerView subclasses? (or, WTF is going in the UIPickerView's responder chain?)
  • Next by thread: Re: Subview and window size
  • Index(es):
    • Date
    • Thread