[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] resize on views within a scrollview?




On 15 Dec 2009, at 15:17, ronald kuivila wrote:


Hi Scott,

I don't think it's a bug. Generally you use scrollviews because you don't  want the contained views to resize. I do see the use case though.


But since there are reasonable cases where for a resize option within a scrollview why limit functionality?

Well I'm not really, but...

It simply adds unnecessary complexity
to the user GUI code.

SCScrollView is already pretty tangled in the back end, so I guess I'm partly just concerned about starting to mess with that. To be blunt I'm not sure that the correct behaviour is as obvious as it might first seem.

How should views which are not currently visible behave, for instance, especially if the internal bounds are larger than what is visible along a resizing axis. Simply matching size to the 'viewport' along that axis is not enough, as the results could be weird. Is there any reasonable case for resizing in two dimensions? Do we just ignore that?

Predictable edge cases start to arise, and although I can see the use in simple cases like yours, I'm a bit concerned about adding something that might behave oddly in more complex ones. The callback at least puts the onus on the user to sort that out.

I think the best way to do this might be to have a callback when a scrollview resizes. I think Cocoa has something like 'didResize' notifications when windows or 

The UserView hack I posted does something like this, so there isn't an immediate need.  
But I would still vote for resize support within a ScrollView as well as having a resize callback (a need I have run into on several occasions).

I have no objection if you can come up with a sensible approach.

I suppose an alternative approach is to make resize behaviour respond to changes in the internal bounds. That might make more sense and would deal–I think–with cases like yours (internal bounds must be at least as big as the visible bounds). I'd need to think about whether that would also cause problems. It could be a bit odd as adding views could trigger resizes. You might still need a callback for complex cases.

Sciss, any swinging perspective on this?

S.