Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text in Scroll question



Carlos Eduardo Mello wrote:

Is there a way to have an offset between a text view and the scroll view it is embeded in? I tried setting different frames and also repositioning in super view but, right before typed text wraps, the scroll resets the text view to its own size/position. Since I added a light background color to the text view, it looks bad with the text touching the edge of the color. So I guess I need to inset the text view and give the scroll view's background the same color. Can this be done with HIView APIs at all (couldn't find it in the headers/docs)? Or do I need to use text handling calls (MLTE?) to set a margin?

Yes, you need to use MLTE... something like this:

	TXNObject	textOb = HITextViewGetTXNObject( textView );
	TXNMargins	margins = {
		0, 4, 0, 4
	};
	TXNControlData	controlData;
	controlData.marginsPtr = &margins;
	TXNControlTag	theTag = kTXNMarginsTag;
	TXNSetTXNObjectControls( textOb, false, 1, &theTag, &controlData );

--
  James W. Walker, Innoventive Software LLC
  <http://www.frameforge3d.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Text in Scroll question (From: Carlos Eduardo Mello <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.