Re: Newbie NSView confusion
Re: Newbie NSView confusion
- Subject: Re: Newbie NSView confusion
- From: Greg Titus <email@hidden>
- Date: Sat, 4 Oct 2003 12:16:13 -0700
Are you sure you don't mean to create an NSTextField, instead of an
NSTextView? That's what the static text in IB is. (And the interface to
set one up is quite a bit simpler.)
Hope this helps,
- Greg
On Saturday, October 4, 2003, at 10:05 AM, Sailor Quasar wrote:
I'm sure this is another of these newbie questions, but I can't seem
to figure out what the trouble is...
I have a custom NSView subclass which as part of its content sets up
several subviews. One, sometimes more, of these is an NSTextView
(non-editable, system font, unbordered, no background, left-aligned)
whose string value is a single character: '.'
This is fine and dandy, I spend lines of code setting up all the
attributes I listed above... unfortunately, the resultant subview
looks nothing like a static text view that I create with IB directly.
IB's static text field 4 pixels wide and 17 pixels tall with a title
of "." has a nice period character, antialiased and in the proper font
and so on, aligned to the bottom of the view rect. Mine comes out with
the . in the (vertical) center of the view, looking like it was drawn
in a 7pt monospace font. Which attribute am I forgetting to set, what
magical incantation do I have to invoke?
<begin short rant>
This is one of those times when Carbon would have been simpler. In
Carbon the call to create such a text field would have required at
most two lines for CreateStaticTextControl() and would have worked on
the first shot. Here in Cocoa I'm playing with attributes of a
over-generalized text view subclass like mad and getting more or less
nowhere.
</end short rant>
-- Sailor Quasar, just another player in The World
"Come with me in the twilight of the summer night for awhile"
Email: email@hidden
_______________________________________________
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.
_______________________________________________
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.