Menu

#74 JSCListView : inconsistencies with allowsDeselection_(true)

open
nobody
SC Classes (22)
5
2010-06-06
2010-06-06
Anonymous
No

(
w = Window.new.front;
v = ListView(w,Rect(10,10,120,70))
.allowsDeselection_( true )
.value_( nil )
.items_([ "Test"])
.background_(Color.clear)
.action_({|v|
if( v.value.notNil, { v.item.postln });
});
)

i just saw a bug: you must follow this order, that is items_ must be after allowsDeselection_( true ) and value_( nil ), otherwise the item is still initially selected.

be careful to test v.value for nil before calling v.item. this is probably also a bug, and instead v.item should return nil instead of throwing an error.

best, -sciss-

Discussion


Log in to post a comment.

MongoDB Logo MongoDB