[comp.sys.next] ScrollView auto-update/resize

adam@mit-amt.MEDIA.MIT.EDU (Adam Glass) (08/15/89)

I need to write some code to make a window and drop a scrollview into it, and
make the scrollview auto resize as the user changes the size of the window.
I can't use IB to make the window, so I can't do it all there. Does anyone
have any ideas/help/CODE(!) to suggest/give? Thanks muchly...

Adam

--
"Offer me anything I ask for..."      | email: adam@media-lab.media.mit.edu |
"Anything you want."                  +---------------------------+---------+
"I want my father back, you son of a bitch." - The Princess Bride | Sigh... |

tsui@silver.bacs.indiana.edu (Yufeng Tsui) (08/16/89)

In article <481@mit-amt.MEDIA.MIT.EDU> adam@mit-amt.MEDIA.MIT.EDU (Adam Glass) writes:
>I need to write some code to make a window and drop a scrollview into it, and
>make the scrollview auto resize as the user changes the size of the window.
>I can't use IB to make the window, so I can't do it all there. Does anyone
>have any ideas/help/CODE(!) to suggest/give? Thanks muchly...
>
>Adam
>
>--
>"Offer me anything I ask for..."      | email: adam@media-lab.media.mit.edu |
>"Anything you want."                  +---------------------------+---------+
>"I want my father back, you son of a bitch." - The Princess Bride | Sigh... |


Check the source code of little that comes with 0.9 What you have to
do is to create a window (myMaineWindow) and create a scrollView.  Then
you have to do:
    if (you need only the scrollView in the window)
       [myMainWindow setContentView:myScrollView];  
    else {
       [[myMainWindow contentView] setAutoresizeSubviews:YES];
       [[myMainWindow contentView] addSubview:myScrollView];
       [myScrollView setDisplayOnScroll:YES];
       [myScrollView setAutosizing:(NX_WIDTHSIZABLE 
 				    | NX_HEIGHTSIZABLE
                                    | ....depends on your need)];
    }
    
           
I have been doing this for the past a few weeks.  But recently I came
back to IB.  Here is another question concerning IB.  How do I use the
objects created in the IB?  I created a preference window for my application
and I want to get the switches and radiobuttons in this window and
connected them to an object defined in my application( IB knows
nothing about theis object), how do i do it?  Are the names listed in
the IB browser varible names I can use in my own object?  Any
suggestion welcome.  Thanks in advance.

--yufeng

tsui@silver.bacs.indiana.edu

jpd00964@uxa.cso.uiuc.edu (08/16/89)

/* Written 12:22 pm  Aug 15, 1989 by tsui@silver.bacs.indiana.edu in uxa.cso.uiuc.edu:comp.sys.next */
>   Here is another question concerning IB.  How do I use the
> objects created in the IB?  I created a preference window for my application
> and I want to get the switches and radiobuttons in this window and
> connected them to an object defined in my application( IB knows
> nothing about theis object), how do i do it?  Are the names listed in
> the IB browser varible names I can use in my own object?  Any
> suggestion welcome.  Thanks in advance.
/* End of text from uxa.cso.uiuc.edu:comp.sys.next */

Check out Chapter 7 of the NeXT dox.  It is in the fourth example.  Sorry to
say, it is not on the on-line dox.  
In a nutshell, you create an object that knows all about your nib.  You then
access the object instead of the nib.  Basically, add in one level of 
indirection.

Michael Rutman
Softmed