Two different behaviors with or without debugging

18 views
Skip to first unread message

kowalsky

unread,
Jun 2, 2014, 12:14:15 PM6/2/14
to
start :-
   
new(Frame, frame('Test')),
    send
(Frame, open),
    send
(Frame, append, new(Pic, picture)),
    send
(Pic, height, 600),
    send
(Pic, display, new(_Ref1, text('This will disappear in 3 seconds', center, font(screen, roman, 16)))),
    sleep
(3),
    send
(Pic, clear),
    sleep
(3),
    send
(Pic, display, new(_Ref2, text('Good bye!', center, font(screen, roman, 16)))),
    sleep
(2),
    send
(Pic, clear).

The following code behaves in two different ways when running it with and without debugging.
Without debugging: shows an initial text 'This will disappear in 3 seconds' for 8 seconds and then it disappears.
With debugging (gtrace): shows the initial text for 3 sec, then it disappears for 3 secs, then a new text 
'Good bye!' appears that disappears in 2 sec.
Why there are two different behaviors of the same code? 

I am using 6.6.6.swi prolog 64 bit version for windows (on windows 8.1).

The same question at stackoverflow.com (without an answer yet):
http://stackoverflow.com/questions/23985197/two-different-behaviors-of-the-same-prolog-code-with-and-without-debugging

kowalsky

unread,
Jun 2, 2014, 12:25:28 PM6/2/14
to swi-p...@googlegroups.com
I checked one more time and I found out the following:
The muse has to be hovering over the form that I see the changes on the canvas.
Note that hovering (moving over the form)!
Just being over the canvas is not sufficient.
-
Is this should be as it is?

Reply all
Reply to author
Forward
0 new messages