Thread View: comp.sys.next.programmer
4 messages
4 total messages
Started by Gordie Freedman
Thu, 08 Oct 1992 02:37
Questions on inherited Text object in a ScrollView
Author: Gordie Freedman
Date: Thu, 08 Oct 1992 02:37
Date: Thu, 08 Oct 1992 02:37
46 lines
2811 bytes
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
Re: Questions on inherited Text object in a ScrollView
Author: Ray Spalding
Date: Thu, 08 Oct 1992 21:14
Date: Thu, 08 Oct 1992 21:14
28 lines
1819 bytes
1819 bytes
In article <73182@apple.Apple.COM> gordie@duts.ccc.amdahl.com writes: > 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. Rather than use the scrolling text palette object, try this: Drag in a CustomView from the Views palette. Change the class of the CustomView to your CText subclass. Then, choose "Group in ScrollView" from the "Layout" menu. > 1) Can I set the Text object's delegate from within IB? If you set things up as above, this should be no problem. Just select the ScrollView, then double-click your CText View. "delegate" should appear in the Connections inspector. > 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 had no trouble with this. Just be careful where you drag to. As you control-drag into the ScrollView, first the ScrollView itself will be highlighted; release here to connect to it. If you continue dragging, the Text object becomes highlighted. -- Ray Spalding, Office of Information Technology Georgia Institute of Technology, Atlanta Georgia, 30332-0715 Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
Re: Questions on inherited Text object in a ScrollView
Author: Ray Spalding
Date: Thu, 08 Oct 1992 21:29
Date: Thu, 08 Oct 1992 21:29
15 lines
1187 bytes
1187 bytes
In article <70514@hydra.gatech.EDU> cc100aa@xray.gatech.edu (Ray Spalding) writes: >In article <73182@apple.Apple.COM> gordie@duts.ccc.amdahl.com writes: >> 1) Can I set the Text object's delegate from within IB? >Just select the ScrollView, then double-click your CText View. >"delegate" should appear in the Connections inspector. Oops ... "delegate" does appear, but I can't seem to connect it up by control-dragging. The solution is to connect the delegate before you Group it in the ScrollView. -- Ray Spalding, Office of Information Technology Georgia Institute of Technology, Atlanta Georgia, 30332-0715 Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
Re: Questions on inherited Text object in a ScrollView
Author: Juan Collas
Date: Thu, 08 Oct 1992 23:50
Date: Thu, 08 Oct 1992 23:50
53 lines
2468 bytes
2468 bytes
In article <73182@apple.Apple.COM> gordie@duts.ccc.amdahl.com (Gordie Freedman) writes: > > So here are my questions: > > 1) Can I set the Text object's delegate from within IB? (Using ctrl-mouse-drag). > I don't think so. I've just done it at runtime in my class. Would be nice ... > 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)? > Easy. Control-Drag from the object to the edge of the scrollview. You should see a black line encompassing the scoller and text object. That's the scrollview. If you move into the text object, only it will have a black line around it and the scroller will be excluded. That's the text object itself. > 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. > It's the way to go. Otherwise, you'll have to replace the default Text object with your CText object at runtime. > 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). > Sorry, can't help you there. The documentation isn't too clear on attributes and the 'touched' button. -- - Juan Collas, ICTV
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads