Hi All,
I submitted a run until feature for the debugger to the Squeak inbox recently and would commit it to trunk except that I'd like the option of having the selection update on each step. But I can't see how to do that. I *think* selection update is done with a callback here in Debugger>>contents:selection:
Smalltalk isMorphic ifTrue: [World addAlarm: #changed:
withArguments: #(contentsSelection) for: self at: (Time millisecondClockValue + 200)].
And I'm not sure how this causes the selection to update. Is it part of text morph draw or a separate thing? This is too convoluted to look through. So perhaps someone can help e. If I want the selection to redraw what's the minimum action necessary. This is as part of a loop that looks like
[self selectedContext == context and: [(value := receiver with: context executeMethod: method) == false]] whileTrue:
[self doStep]. i.e. after the doStep I'd like to force the code pane to update its selection. AdvThanksance
-- best, Eliot |
This works for me:
doStepSeveral 10 timesRepeat: [ self doStep. self changed: #contentsSelection. World displayWorldSafely. (Delay forMilliseconds: 100) wait. "in case you want to see each step" ] Cheers, Bob On 11/14/12 1:26 PM, Eliot Miranda
wrote:
Hi All, |
Hi Bob,
thanks, but no thanks <blush>. I want to see the update as fast as possible, even if it flickers like crazy. I don't want to display the whole world, just the text morph in question.
On Wed, Nov 14, 2012 at 11:13 AM, Bob Arning <[hidden email]> wrote:
best, Eliot |
But this is how Morphic drawing works. If only your text morph changed, then only that morph will be redrawn. And since no events are processed in that loop, this should be the case. - Bert - On 15.11.2012, at 09:16, Eliot Miranda <[hidden email]> wrote: Hi Bob, |
In reply to this post by Eliot Miranda-2
If you want speed, then why not limit the
visual updates to something you can see:
doStepSeveral | n t lastDisplay | t := [ (n := 500) timesRepeat: [ self doStep. ]. ] timeToRun. Transcript show: t asString,' ms for ',n asString,' steps without display'; cr. t := [ (n := 500) timesRepeat: [ self doStep. self changed: #contentsSelection. World displayWorldSafely. ]. ] timeToRun. Transcript show: t asString,' ms for ',n asString,' steps with display'; cr. lastDisplay := Time millisecondClockValue. t := [ (n := 500) timesRepeat: [ self doStep. (lastDisplay - Time millisecondClockValue) abs > 20 ifTrue: [ lastDisplay := Time millisecondClockValue. self changed: #contentsSelection. World displayWorldSafely. ]. ]. ] timeToRun. Transcript show: t asString,' ms for ',n asString,' steps with occasional display'; cr. yields: 68 ms for 500 steps without display 4290 ms for 500 steps with display 101 ms for 500 steps with occasional display Cheers, Bob On 11/15/12 3:16 AM, Eliot Miranda
wrote:
Hi Bob, |
Thanks, Bob. I'll try the occasional approach. That indeed seems to do what I want.
On Thu, Nov 15, 2012 at 5:40 AM, Bob Arning <[hidden email]> wrote:
best, Eliot |
In reply to this post by Bert Freudenberg
This is fun! If you use #send rather than
#doStep, you can watch code run like a movie.
doStepSeveral | n | n := 500. n timesRepeat: [ self send. self changed: #contentsSelection. World displayWorldSafely. (Delay forMilliseconds: 250) wait. ]. Cheers, Bob On 11/15/12 8:39 AM, Bert Freudenberg
wrote:
|
Hi Bob,
cool! I've just committed the run until code. Please feel free to add a variant that uses send. send until...? On Thu, Nov 15, 2012 at 12:44 PM, Bob Arning <[hidden email]> wrote:
best, Eliot |
Free forum by Nabble | Edit this page |