<div dir="ltr"><div><div>Ah we cross posted, good find!<br><br></div>Those guys messing with World <font face="Georgia">doOneCycle</font> are just like the sorcerer's apprentice...<br></div>Please don't try to rule the World!<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/18 Bob Arning <span dir="ltr"><<a href="mailto:arning315@comcast.net" target="_blank">arning315@comcast.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<font face="Georgia">Well, this I can reproduce.<br>
<br>
So if we look at this puppy:<br>
========================================<br>
!PluggableListMorphOfMany methodsFor: 'event handling' stamp: 'raa
9/17/2013 18:02'!<br>
mouseMove: event <br>
"The mouse has moved, as characterized by the event provided.
Adjust the scrollbar, and alter the selection as appropriate"<br>
<br>
| oldIndex oldVal row index bobsDebugging |<br>
<br>
bobsDebugging _ OrderedCollection new.<br>
bobsDebugging add: {'1'. dragOnOrOff}.<br>
event position y < self top <br>
ifTrue: <br>
[scrollBar scrollUp: 1.<br>
row := self rowAtLocation: scroller topLeft + (1 @ 1)]<br>
ifFalse: <br>
[row := event position y > self bottom <br>
ifTrue: <br>
[scrollBar scrollDown: 1.<br>
self rowAtLocation: scroller bottomLeft + (1 @
-1)]<br>
ifFalse: [ self rowAtLocation: event position]].<br>
row = 0 ifTrue: [^super mouseDown: event].<br>
index := self modelIndexFor: row.<br>
<br>
model okToChange ifFalse: [^self]. "No change if model is
locked"<br>
bobsDebugging add: {'2'. dragOnOrOff}.<br>
<br>
dragOnOrOff ifNil: <br>
["Was not set at mouse down, which means the mouse
must have gone down in an area where there was no list item"<br>
dragOnOrOff := (self listSelectionAt: index) not].<br>
bobsDebugging add: {'3'. dragOnOrOff}.<br>
<br>
"Set meaning for subsequent dragging of selection"<br>
oldIndex := self getCurrentSelectionIndex.<br>
oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt:
oldIndex].<br>
<br>
"Set or clear new primary selection (listIndex)"<br>
dragOnOrOff <br>
ifTrue: [self changeModelSelection: index]<br>
ifFalse: [self changeModelSelection: 0].<br>
<br>
"Need to restore the old one, due to how model works, and set
new one."<br>
oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put:
oldVal].<br>
bobsDebugging add: {'4'. dragOnOrOff}.<br>
self listSelectionAt: index put: dragOnOrOff.<br>
! !<br>
==========================================<br>
I added some debugging code which reports<br>
<br>
an OrderedCollection(#('1' false) #('2' false) #('3' false) #('4'
nil))<br>
<br>
So we clobbered </font><font face="Georgia"><font face="Georgia">dragOnOrOff
between the 3rd and 4th entries in the list. That's happening
because of:<br>
<br>
</font>============================================<br>
!PluggableListMorph methodsFor: 'model access' stamp: 'kb 6/5/2013
21:12'!<br>
changeModelSelection: anInteger<br>
" Change the model's selected item index to be anInteger.
Enable the pre selection highlight. Step the World forward to let
the pre selection highlight take effect. "<br>
<br>
self rowAboutToBecomeSelected: (self uiIndexFor: anInteger).<br>
World doOneCycle.<br>
setIndexSelector ifNotNil: [<br>
model perform: setIndexSelector with: anInteger ].! !<br>
=============================================<br>
<br>
The World doOneCycle permits another ui event to be processed
while we are still in the mouseMove:. If the event is a mouseUp:
then<br>
<br>
mouseUp: event<br>
<br>
dragOnOrOff := nil. "So improperly started drags will have
not effect"<br>
<br>
kaboom.<br>
<br>
Cheers,<br>
Bob<br>
<br>
</font><div class="im">
<div>On 9/17/13 4:26 PM, Nicolas Cellier
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Ah, sorry, it was not a debugger, it was a
ChangeList, and curiously, the listSelections effectively
contains a non boolean (nil)<br>
#(false false false true true nil true false false false false
false false false false false false)<br>
</div>
<div class="gmail_extra"><br>
</div>
</blockquote>
<br>
</div></div>
<br><br>
<br></blockquote></div><br></div>