UIPainterView.st
changeset 2560 efad0ef440c7
parent 2537 12e3b32befe4
child 2582 f34eb91780f4
equal deleted inserted replaced
2559:04b2605a66b2 2560:efad0ef440c7
   382     "add the specs to the object view; 
   382     "add the specs to the object view; 
   383      if given a collection of specs, returns a list of pasted widgets;
   383      if given a collection of specs, returns a list of pasted widgets;
   384      if given a single spec, returns that view (sigh - a stupid bw-compatibility kludge)"
   384      if given a single spec, returns that view (sigh - a stupid bw-compatibility kludge)"
   385 
   385 
   386     |sensor specsToPaste pasteOffset builder newSel 
   386     |sensor specsToPaste pasteOffset builder newSel 
   387      bounds containerToPasteInto pastePoint beforeIndex|
   387      bounds containerToPasteInto pastePoint beforeIndex count|
   388 
   388 
   389     treeView askForSelectionChangeAllowed ifFalse:[^ nil].
   389     treeView askForSelectionChangeAllowed ifFalse:[^ nil].
   390 
   390 
   391     sensor := self window sensor.
   391     sensor := self window sensor.
   392 
   392 
   522     self realizeAllSubViews.
   522     self realizeAllSubViews.
   523     "/ newSel do:[:v| v raise].
   523     "/ newSel do:[:v| v raise].
   524     self elementChangedSize:containerToPasteInto.
   524     self elementChangedSize:containerToPasteInto.
   525 
   525 
   526     "/ because the new-created view will destroy the handles, when it redraws itself,
   526     "/ because the new-created view will destroy the handles, when it redraws itself,
   527     "/ give it a chance to do so, before we return.
   527     "/ give it a chance to do so, before we return. (bail out after half a second, in case of trouble)
   528     [ (newSel conform:[:v | v shown]) ] whileFalse:[
   528     count := 0.
       
   529     [ (newSel conform:[:v | v shown]) or:[count > 50] ] whileFalse:[
       
   530         self windowGroup repairDamage.
   529         Delay waitForSeconds:0.01.
   531         Delay waitForSeconds:0.01.
       
   532         count := count+1.
   530     ].
   533     ].
   531     Delay waitForSeconds:0.01.
   534     Delay waitForSeconds:0.01.
   532     self windowGroup repairDamage.
   535     self windowGroup repairDamage.
   533 
   536 
   534     newSel size == 1 ifTrue:[newSel := newSel at:1].
   537     newSel size == 1 ifTrue:[newSel := newSel at:1].