repty abs(diffy/pickunits[ incrx pickunits[ ((diffx or - incry pickunits[ ((diffy or - return incrxreptxincryrepty incr per movenumber moves from last to event click /trunc div required def onmove(selfevent)traceevent('onmove'event move current object to click object self object ignore some ops during mv if object and object not in self movingmsecs int(pickdelays[ parms 'delay=% msecunits=% (msecspickunits[ ]self settextinfo(parmsself moving append(objectcanvas event widget incrxreptxincryrepty self plotmoves(eventfor in range(reptx)canvas move(objectincrx canvas update(time sleep(pickdelays[ ]for in range(repty)canvas move(object incrycanvas update(update runs other ops time sleep(pickdelays[ ]sleep until next move self moving remove(objectif self object =objectself where event def onselect(selfevent)self where event self object self canvas find_closest(event xevent )[ def ondrag(selfevent)diffx event self where diffy event self where self canvas move(self objectdiffxdiffyself where event tuple ok if object in moving throws it off course def onoptions(selfevent)keymap ' 'lambda selfself changeoption(pickwidths'pen width')' 'lambda selfself changeoption(pickfills'color')' 'lambda selfself changeoption(pickunits'move unit')' 'lambda selfself changeoption(pickdelays'move delay')' 'lambda selfself changeoption(pickpens'pen mode')' 'lambda selfself changedraw(canvas create_oval'oval')' 'lambda selfself changedraw(canvas create_rectangle'rect')' 'lambda selfself changedraw(canvas create_line'line')' 'lambda selfself changedraw(canvas create_arc'arc')' 'movingpics deleteobject' 'movingpics raiseobject' 'movingpics lowerobjectif only call pattern ' 'movingpics fillobjectuse unbound method objects ' 'movingpics fillbackgroundelse lambda passed self ' 'movingpics addphotoitem' 'movingpics savepostscript complete gui programs