<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body 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>
      &nbsp;&nbsp;&nbsp; "The mouse has moved, as characterized by the event provided.&nbsp;
      Adjust the scrollbar, and alter the selection as appropriate"<br>
      <br>
      &nbsp;&nbsp;&nbsp; | oldIndex oldVal row index bobsDebugging |<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; bobsDebugging _ OrderedCollection new.<br>
      &nbsp;&nbsp;&nbsp; bobsDebugging add: {'1'. dragOnOrOff}.<br>
      &nbsp;&nbsp;&nbsp; event position y &lt; self top <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [scrollBar scrollUp: 1.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; row := self rowAtLocation: scroller topLeft + (1 @ 1)]<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [row := event position y &gt; self bottom <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [scrollBar scrollDown: 1.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self rowAtLocation: scroller bottomLeft + (1 @
      -1)]<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [ self rowAtLocation: event position]].<br>
      &nbsp;&nbsp;&nbsp; row = 0 ifTrue: [^super mouseDown: event].<br>
      &nbsp;&nbsp;&nbsp; index := self modelIndexFor: row.<br>
      <br>
      &nbsp;&nbsp;&nbsp; model okToChange ifFalse: [^self].&nbsp;&nbsp;&nbsp; "No change if model is
      locked"<br>
      &nbsp;&nbsp;&nbsp; bobsDebugging add: {'2'. dragOnOrOff}.<br>
      <br>
      &nbsp;&nbsp;&nbsp; dragOnOrOff ifNil: <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ["Was not set at mouse down, which means the mouse
      must have gone down in an area where there was no list item"<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dragOnOrOff := (self listSelectionAt: index) not].<br>
      &nbsp;&nbsp;&nbsp; bobsDebugging add: {'3'. dragOnOrOff}.<br>
      <br>
      &nbsp;&nbsp;&nbsp; "Set meaning for subsequent dragging of selection"<br>
      &nbsp;&nbsp;&nbsp; oldIndex := self getCurrentSelectionIndex.<br>
      &nbsp;&nbsp;&nbsp; oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt:
      oldIndex].<br>
      <br>
      &nbsp;&nbsp;&nbsp; "Set or clear new primary selection (listIndex)"<br>
      &nbsp;&nbsp;&nbsp; dragOnOrOff <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: [self changeModelSelection: index]<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [self changeModelSelection: 0].<br>
      <br>
      &nbsp;&nbsp;&nbsp; "Need to restore the old one, due to how model works, and set
      new one."<br>
      &nbsp;&nbsp;&nbsp; oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put:
      oldVal].<br>
      &nbsp;&nbsp;&nbsp; bobsDebugging add: {'4'. dragOnOrOff}.<br>
      &nbsp;&nbsp;&nbsp; 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>
      &nbsp;&nbsp;&nbsp; " 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>
      &nbsp;&nbsp;&nbsp; self rowAboutToBecomeSelected: (self uiIndexFor: anInteger).<br>
      &nbsp;&nbsp;&nbsp; World doOneCycle.<br>
      &nbsp;&nbsp;&nbsp; setIndexSelector ifNotNil: [<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 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>
      &nbsp;&nbsp;&nbsp; dragOnOrOff := nil.&nbsp; "So improperly started drags will have
      not effect"<br>
      <br>
      kaboom.<br>
      <br>
      Cheers,<br>
      Bob<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 9/17/13 4:26 PM, Nicolas Cellier
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAKnRiT6hZw9XbNYg3sdKX3F10=m4JFB9UrQbt2d57kWBors9QA@mail.gmail.com"
      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>
        &nbsp;#(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>
  </body>
</html>