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

Re: [Sc-devel] SCScrollView beachball?



great, Scott,
seems to work in my more complex GUI too.
thanks,
Jan

On Dec 2, 2007, at 12:59 PM, Scott Wilson wrote:

I've committed a fix now. It turned out to be fairly simple. The Scrollviews use userScrolled to fire their action in most cases, but if the mutex is already locked, you've got a problem. (This also comes up with visibleOrigin, which fires the action from the lang). In this case adding or removing views sometimes caused incidental scrolling when the enclosed graphview resized. I figure the action shouldn't fire in such cases anyway, so I just blocked.

Works for me now with your example. Give it a try and let me know if there're any other problems.

S.

On 1 Dec 2007, at 19:49, Scott Wilson wrote:

Okay, something to do on my Sunday afternoon!

The other fix is committed now, btw.

S.

On 1 Dec 2007, at 19:39, Jan Trutzschler wrote:

Hi Scott,

below is a simple example. It doesn't crash immediately but add a few views and remove them, scroll around and remove and at a certain point it's time for beachball!
cheers,
Jan

(
var addView, removeView, allviews, win, scroll;
win = SCWindow.new;
win.view.decorator_(FlowLayout(Rect(0, 0, win.view.bounds.width, 20)));

SCButton(win, Rect(0,0, 80,20)).states_([['add']])
	.action_{|v| addView.value};
SCButton(win, Rect(0,0, 80,20)).states_([['remove']])
	.action_{|v| removeView.value};	
win.view.decorator.nextLine;	
scroll = SCScrollView(win, Rect(0,24,150,100));

scroll.decorator_(FlowLayout(scroll.bounds));

addView = {
	allviews = allviews.add(SC2DSlider(scroll, Rect(0,0,100,100)));
};

removeView = {
	if(allviews.size > 0){
		allviews.last.remove;
		allviews.removeAt(allviews.size-1);
		scroll.decorator.shift(0, -100);
	}
};

win.front;
)



On Dec 1, 2007, at 2:30 PM, Scott Wilson wrote:

Hi,

Can you send a simple example that causes this?

There's some futzing involved in making SCScrollView behave as expected, so it's possible I've missed a corner case.

S.

On 29 Nov 2007, at 16:18, Jan Trutzschler wrote:

Hi,
i'm adding & removing views from a SCScrollView and at a certain point (i guess when it's trying to hide the scrollbars) SC shows me a beachball ... i paused the debugger and he hangs at

- (void)userScrolled:(NSNotification *)notification
{
// if this happens from a visibleOrigin method we can't use sendMessage, so the action gets called from the lang
	if(!((SCScrollTopView*)mTopView)->isInSetClipViewOrigin()) {
mTopView->sendMessage(s_doaction, 0, 0, 0); // this must be a scroll view
	}
}

i commented the sendMessage out and the beachball does not coming back anymore ...

any ideas?

Jan

_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel


_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel

_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel


_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel


_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel