• 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
More on text views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More on text views


  • Subject: More on text views
  • From: April Gendill <email@hidden>
  • Date: Thu, 28 Aug 2003 22:58:21 -0700

aTabItem = [[NSTabViewItem alloc]init];
NSRect scrollRect = NSMakeRect(16.0,0.0,342.0,532.0);

NSScrollView *theScrollView = [[NSScrollView alloc]
initWithFrame:scrollRect];


[theScrollView setHasVerticalScroller:YES];
[theScrollView setHasHorizontalScroller:NO];

[aTabItem setView:theScrollView];

NSTextView *theTextView = [[NSTextView alloc]
initWithFrame:[theScrollView frame]];

[theScrollView setDocumentView:theTextView];
[aTabItem setIdentifier:pageIdent];
[aTabItem setLabel:pageName];
[theTabs addTabViewItem:aTabItem];

okay... some one responded with a snippette of code and this is pretty
much that code with changes needed... here are the problems I am having
and cannot figure out why...
first off. the Application is a window in that window is a tab view. I
am adding a tabview item, and in theat item i need two things added
programatically. 1 a scrollview. Above adds said scroll view but
regaurdless of how I define the scrollrect, it ALWAYS fills the tab. so
obviously I'm doing something wrong there, and have no clue what.
Part 2 I need to add a textfield that has no background... and I don't
see any method for adding textfields to a view programatically.
Thing with this is I need this text field to also center it's text and
I see nothing to do that either...
mainly though. why is my scroll view taking up the tab even through I
am defining the rect from bottom left corner with the number I got out
of IB from a tab it is suppose to mimic.

Question 2... is there a was to dupelicate a tab's structure and not
have to futz with all the extra stuff? If it's possible I could simply
copy a tanview item, define it's text string and move on with my life.


April.
_______________________________________________
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: More on text views
      • From: "Alastair J.Houghton" <email@hidden>
  • Prev by Date: Re: invoke action
  • Next by Date: How to show a controller when no movie loaded
  • Previous by thread: Re: invoke action
  • Next by thread: Re: More on text views
  • Index(es):
    • Date
    • Thread