Newbie NSView confusion
Newbie NSView confusion
- Subject: Newbie NSView confusion
- From: Sailor Quasar <email@hidden>
- Date: Sat, 4 Oct 2003 13:05:27 -0400
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.