Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-23 Thread Quincey Morris

On Mar 23, 2009, at 02:33, Ken Tozier wrote:

The new issue though is that when I set the size of the content view  
(document view?) the scroller's size changes to the new size of the  
content. I've checked and rechecked to make sure all the autosize  
parts are set up in IB correctly, but no matter what I do, I can't  
both set the size of the scroller content view and preserve the  
frame of the scroll view.


At this point, step 1 is probably to log the frame rects of the scroll  
view, clip view and document/content view after the resize is  
finished, and find out for sure which one is wrong.


Step 2 could be to register to receive frame-changed notifications  
from each of the views, and watch the sequence of changes to see where  
it goes wrong. Chances are, things aren't happening in the order your  
code thinks they are.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-23 Thread Ken Tozier

Thanks Quincey this helped. I'm getting scroll bars now.

The new issue though is that when I set the size of the content view  
(document view?) the scroller's size changes to the new size of the  
content. I've checked and rechecked to make sure all the autosize  
parts are set up in IB correctly, but no matter what I do, I can't  
both set the size of the scroller content view and preserve the frame  
of the scroll view.


Here's how I set up the autosize options in IB

Scroll view options:
outside:
top, left, bottom, right
Inside
scale width, scale height

Content view options:
Outside:
top, left, right
Inside:
scale width

In my code, the content view recalculates it's height when the  
contents are refreshed with new data. The new data comes from the  
result of database searches and I display te results in the content  
view.


When I change the height, the scroll view always changes as well. How  
can I resize the contents of a scroll view without also changing the  
size of the scroll view that contains it?





On Mar 23, 2009, at 1:50 AM, Quincey Morris wrote:


If scroll bars don't appear, there are 2 likely causes:

-- You are failing to set your custom view's "depth" properly. The  
depth is determined by your custom view's frame. Make sure you're  
setting the frame to the correct height (and not, for example,  
setting just the bounds to the desired height).


-- The autoresize flags for your custom view are causing it to be  
resized because the enclosing scroll view is being resized as part  
of the window setup. If you want to control the view frame height  
yourself, make sure the vertical autoresize widget for the custom  
view in IB is not set to change the view height. You may want to  
also turn off the scroll view's "resizes subviews automatically",  
unless you want the width of your view to match the scroll view  
automatically.


Note that the non-appearance of the scroll bar most likely results  
from the above in combination with the "hides scroll bars  
automatically" option for the scroll view in IB. If you uncheck  
that, you should see the scroll bar, but the scroll bar would then  
be inactive if you don't maintain the view height correctly.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Quincey Morris

On Mar 22, 2009, at 21:12, Ken Tozier wrote:


Hi

I have a custom view inside a scroll view and all works nicely  
except when the custom view's contents exceeds the depth of the  
scroll view. The scroll bars don't appear. I created the scroll view  
in IB from a standard widget and did nothing more than set the class  
of default content view to my custom class.


I read the NSScrollView docs and the companion "Scroll View  
Programming Guide for Cocoa" and notice that neither the contentView  
nor the documentView are available from inside IB. I looked at the  
different IB data views with scroll bars, checking what their  
outlets are and tried setting mine up the same, but they must be  
doing something behind the scenes.


What do I need to do to get the scroll view to notice when my custom  
view exceeds it's depth?


The "document view" *is* available from inside IB. It's the same thing  
as what you called the "default content view". IB only suppresses  
explicit display of the clip view.


If scroll bars don't appear, there are 2 likely causes:

-- You are failing to set your custom view's "depth" properly. The  
depth is determined by your custom view's frame. Make sure you're  
setting the frame to the correct height (and not, for example, setting  
just the bounds to the desired height).


-- The autoresize flags for your custom view are causing it to be  
resized because the enclosing scroll view is being resized as part of  
the window setup. If you want to control the view frame height  
yourself, make sure the vertical autoresize widget for the custom view  
in IB is not set to change the view height. You may want to also turn  
off the scroll view's "resizes subviews automatically", unless you  
want the width of your view to match the scroll view automatically.


Note that the non-appearance of the scroll bar most likely results  
from the above in combination with the "hides scroll bars  
automatically" option for the scroll view in IB. If you uncheck that,  
you should see the scroll bar, but the scroll bar would then be  
inactive if you don't maintain the view height correctly.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Ron Fleckner
Yes, the scroll bars never appeared in my case as well.  That's why I  
resorted to the workaround.

Good luck.


On 23/03/2009, at 4:17 PM, Ken Tozier wrote:

I think my issue is slightly different. The scroll bars never  
appear, no matter how much overflow there might be. I generally  
don't have a problem using table views as they seem to have some  
built-in mechanism for notifying the scroll view that they are  
deeper than it is. I'm trying to make my custom view do what table  
views are doing. I was hoping to do it all in IB but it's looking  
like I'll have to do the notifications programatically.



On Mar 23, 2009, at 1:06 AM, Ron Fleckner wrote:



I may be wrong, but I came across similar scrollview behaviour in  
Tiger.  IIRC, I asked about it here on cocoa-dev and got back that  
it was a known bug.  As I say, not sure if this is still the case.


My workaround was to uncheck the 'has scroll bar' in IB, then, in  
my case:


id scrollview = [[tableView superview] superview];
[scrollview setHasVerticalScroller:YES];
[scrollview display];

The behaviour I was getting in my table view was that if you/the  
user selected a visible row, then arrow keyed down, it would  
continue past the bottom of the window but no (vertical) scroll bar  
would show and you couldn't see what was actually selected.


HTH,

Ron


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Ken Tozier
I think my issue is slightly different. The scroll bars never appear,  
no matter how much overflow there might be. I generally don't have a  
problem using table views as they seem to have some built-in mechanism  
for notifying the scroll view that they are deeper than it is. I'm  
trying to make my custom view do what table views are doing. I was  
hoping to do it all in IB but it's looking like I'll have to do the  
notifications programatically.



On Mar 23, 2009, at 1:06 AM, Ron Fleckner wrote:



I may be wrong, but I came across similar scrollview behaviour in  
Tiger.  IIRC, I asked about it here on cocoa-dev and got back that  
it was a known bug.  As I say, not sure if this is still the case.


My workaround was to uncheck the 'has scroll bar' in IB, then, in my  
case:


id scrollview = [[tableView superview] superview];
[scrollview setHasVerticalScroller:YES];
[scrollview display];

The behaviour I was getting in my table view was that if you/the  
user selected a visible row, then arrow keyed down, it would  
continue past the bottom of the window but no (vertical) scroll bar  
would show and you couldn't see what was actually selected.


HTH,

Ron




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Ron Fleckner


On 23/03/2009, at 3:12 PM, Ken Tozier wrote:


Hi

I have a custom view inside a scroll view and all works nicely  
except when the custom view's contents exceeds the depth of the  
scroll view. The scroll bars don't appear. I created the scroll view  
in IB from a standard widget and did nothing more than set the class  
of default content view to my custom class.


I read the NSScrollView docs and the companion "Scroll View  
Programming Guide for Cocoa" and notice that neither the contentView  
nor the documentView are available from inside IB. I looked at the  
different IB data views with scroll bars, checking what their  
outlets are and tried setting mine up the same, but they must be  
doing something behind the scenes.


What do I need to do to get the scroll view to notice when my custom  
view exceeds it's depth?


Hi Ken,

I may be wrong, but I came across similar scrollview behaviour in  
Tiger.  IIRC, I asked about it here on cocoa-dev and got back that it  
was a known bug.  As I say, not sure if this is still the case.


My workaround was to uncheck the 'has scroll bar' in IB, then, in my  
case:


id scrollview = [[tableView superview] superview];
[scrollview setHasVerticalScroller:YES];
[scrollview display];

The behaviour I was getting in my table view was that if you/the user  
selected a visible row, then arrow keyed down, it would continue past  
the bottom of the window but no (vertical) scroll bar would show and  
you couldn't see what was actually selected.


HTH,

Ron


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Ken Tozier

Hi

I have a custom view inside a scroll view and all works nicely except  
when the custom view's contents exceeds the depth of the scroll view.  
The scroll bars don't appear. I created the scroll view in IB from a  
standard widget and did nothing more than set the class of default  
content view to my custom class.


I read the NSScrollView docs and the companion "Scroll View  
Programming Guide for Cocoa" and notice that neither the contentView  
nor the documentView are available from inside IB. I looked at the  
different IB data views with scroll bars, checking what their outlets  
are and tried setting mine up the same, but they must be doing  
something behind the scenes.


What do I need to do to get the scroll view to notice when my custom  
view exceeds it's depth?



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com