🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1304

Questions on inherited Text object in a ScrollView

#1304
From: Gordie Freedman
Date: Thu, 08 Oct 1992 02:37
46 lines
2811 bytes
I am trying to get a text object inside of a ScrollView to behave in
a custom way. I think the only way to do this is to subclass it, 
override the methods I want to modify, and of course add some instance
variables to use. I know how to do this, but I can't figure out how to
get IB to make a .nib with a window containing a ScrollView containing
my inherited CText object. I have some other related questions also.


More explicitly:

I want to override keyDown and mouseDown so that I can get control and perform
some checking on these events. I also want to override the methods for 
underline and the alignment methods so I can change the X in the upper right
corner of the window to indicate the document needs saving. I can't seem to
get these to the delegate, although I know how to get messages to the
delegate for textDidGetKeys:isEmpty: (This doesn't report changes
due to underline, alignment, etc). I also couldn't figure out how to set
a Text object's delegate from within IB, I had to do it manually from in 
the init routine of the .nib's owner.


So here are my questions:

 1) Can I set the Text object's delegate from within IB? (Using ctrl-mouse-drag).

 2) How can I set an object outlet variable to a ScrollView object
	from within IB (it always sets it to the Text object within the
	ScrollView). I'm trying to do this so I can create a normal ScrollView
	from within IB and than in the init code of the .nib's owner I can
	do a setDocument (I think that is the call) on the ScrollView. I need to
	set one of the "file's owner" object's instance variables to the ScrollView
	so I can reference the ScrollView later. (On a related note, can I get
	the ScrollView from the Window object, which I can connect)?

 3) How can I use IB to set up a ScrollView containing my inherited CText
	object, rather than the Text object it usually contains? I started
	reading about Palettes, but I'm not sure if this is the way to go.

 4) Is there some way for the Text object's delegate to get notification
	when the alignment or underline attribute is changed? (I think I also
	don't get color changes either, so I need that too).

Thanks in advance, 

Gordie Freedman
gordie@kaleida.com
Technical Details
Message-ID: <73182@apple.Apple.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!moon!gordie

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!moon!gordie
From: gordie@duts.ccc.amdahl.com (Gordie Freedman)
Newsgroups: comp.sys.next.programmer
Subject: Questions on inherited Text object in a ScrollView
Keywords: Text object ScrollView Interface Builder IB inherit
Message-ID: <73182@apple.Apple.COM>
Date: 8 Oct 92 02:37:49 GMT
Sender: daemon@Apple.COM
Reply-To: gordie@duts.ccc.amdahl.com
Organization: Happy hacker bait and tackle shop
Lines: 46