<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&#39;s apprentice...<br></div>Please don&#39;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">&lt;<a href="mailto:arning315@comcast.net" target="_blank">arning315@comcast.net</a>&gt;</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: &#39;event handling&#39; stamp: &#39;raa
      9/17/2013 18:02&#39;!<br>
      mouseMove: event <br>
          &quot;The mouse has moved, as characterized by the event provided. 
      Adjust the scrollbar, and alter the selection as appropriate&quot;<br>
      <br>
          | oldIndex oldVal row index bobsDebugging |<br>
          <br>
          bobsDebugging _ OrderedCollection new.<br>
          bobsDebugging add: {&#39;1&#39;. dragOnOrOff}.<br>
          event position y &lt; self top <br>
              ifTrue: <br>
                  [scrollBar scrollUp: 1.<br>
                  row := self rowAtLocation: scroller topLeft + (1 @ 1)]<br>
              ifFalse: <br>
                  [row := event position y &gt; 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].    &quot;No change if model is
      locked&quot;<br>
          bobsDebugging add: {&#39;2&#39;. dragOnOrOff}.<br>
      <br>
          dragOnOrOff ifNil: <br>
                  [&quot;Was not set at mouse down, which means the mouse
      must have gone down in an area where there was no list item&quot;<br>
                  dragOnOrOff := (self listSelectionAt: index) not].<br>
          bobsDebugging add: {&#39;3&#39;. dragOnOrOff}.<br>
      <br>
          &quot;Set meaning for subsequent dragging of selection&quot;<br>
          oldIndex := self getCurrentSelectionIndex.<br>
          oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt:
      oldIndex].<br>
      <br>
          &quot;Set or clear new primary selection (listIndex)&quot;<br>
          dragOnOrOff <br>
              ifTrue: [self changeModelSelection: index]<br>
              ifFalse: [self changeModelSelection: 0].<br>
      <br>
          &quot;Need to restore the old one, due to how model works, and set
      new one.&quot;<br>
          oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put:
      oldVal].<br>
          bobsDebugging add: {&#39;4&#39;. dragOnOrOff}.<br>
          self listSelectionAt: index put: dragOnOrOff.<br>
      ! !<br>
      ==========================================<br>
      I added some debugging code which reports<br>
      <br>
      an OrderedCollection(#(&#39;1&#39; false) #(&#39;2&#39; false) #(&#39;3&#39; false) #(&#39;4&#39;
      nil))<br>
      <br>
      So we clobbered </font><font face="Georgia"><font face="Georgia">dragOnOrOff
        between the 3rd and 4th entries in the list. That&#39;s happening
        because of:<br>
        <br>
      </font>============================================<br>
      !PluggableListMorph methodsFor: &#39;model access&#39; stamp: &#39;kb 6/5/2013
      21:12&#39;!<br>
      changeModelSelection: anInteger<br>
          &quot; Change the model&#39;s selected item index to be anInteger.
      Enable the pre selection highlight. Step the World forward to let
      the pre selection highlight take effect. &quot;<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.  &quot;So improperly started drags will have
      not effect&quot;<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>