• 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
Creating a NSScrollView programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating a NSScrollView programmatically


  • Subject: Creating a NSScrollView programmatically
  • From: Arthur VIGAN <email@hidden>
  • Date: Mon, 27 Oct 2003 12:23:29 +0100

Hi,

I am trying to create an NSScrollView programmatically in the content view of a window. I have the following code, but it doesn't work (scrollView and mainWindow are defined in the header file):

- (IBAction)createScrollView:(id)sender
{
NSView *windowContentView = [mainWindow contentView];
NSRect windowContentBounds = [windowContentView bounds];

scrollView = [[NSScrollView alloc] init];

[scrollView setBorderType:NSNoBorder];
[scrollView setHasVerticalScroller:YES];
[scrollView setBounds: windowContentBounds];

[windowContentView addSubview:scrollView];
}

When my window appears, it is just empty. Can anybody help?

-- Arthur
_______________________________________________
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: Creating a NSScrollView programmatically
      • From: "Alastair J.Houghton" <email@hidden>
    • Re: Creating a NSScrollView programmatically
      • From: Dusan Vujosevic <email@hidden>
  • Prev by Date: Re: Xcode bug
  • Next by Date: NSTextBox - select
  • Previous by thread: RE: CustomView outlet is always (null)
  • Next by thread: Re: Creating a NSScrollView programmatically
  • Index(es):
    • Date
    • Thread