Hello,
The following code sample from a language-learning system based on colors shows a number of colored rectangles within a frame. When the first (white) rectangle is activated with a double-click from the mouse, the letter "a" appears within the rectangle and its corresponding sound (in French) can be heard:
The problem: how can I add a timer that would enable the character "a" to blink when it is clicked upon? Likewise, can the sound "a" also be repeated if needed?
Any advice in this regard will be appreciated.
The following code sample from a language-learning system based on colors shows a number of colored rectangles within a frame. When the first (white) rectangle is activated with a double-click from the mouse, the letter "a" appears within the rectangle and its corresponding sound (in French) can be heard:
Code:
go:-
new(Frame, frame('')),
new(W, window('La lecture en couleurs')),
send(W,background,colour(black)),
send(W, size, size(850,500)),
send(W, display,
new(L, line(0,250,850,250))),
send(L, colour, white),
send(W, display,
new(B1, box(75,25)), point(35,20)),
send(B1, fill_pattern, colour(white)),
send(B1, recogniser,
click_gesture(left, '', double,
message(@prolog, message_a, W))),
send(W, display,
new(B2, box(75,25)), point(135,20)),
send(B2, fill_pattern, colour(blue)),
send(B2, recogniser,
click_gesture(left, '', double,
message(@prolog, message_o, W))),
send(W, display,
new(B3, box(75,25)), point(230,20)),
send(B3, fill_pattern, colour(yellow)),
send(B3, recogniser,
click_gesture(left, '', double,
message(@prolog, message_m, W))),
send(W, display,
new(B4, box(75,25)), point(345,20)),
send(B4, fill_pattern, colour(green)),
send(B4, recogniser,
click_gesture(left, '', double,
message(@prolog, message_i, W))),
send(W, display,
new(B5, box(75,25)), point(145, 135)),
send(B5, fill_pattern, colour(red)),
send(B5, recogniser,
click_gesture(left, '', double,
message(@prolog, message_r, W))),
...,
send(Frame, open).
message_a(W) :-
new(Tx1, text('a')),
send(W, display, Tx1, point(75,25)),
send(W, display, Tx1, point(65,20)),
send(Tx1, font, font(times, bold, 16)),
win_shell(open,'C://projetSW//interface//devel//a',hide).
The problem: how can I add a timer that would enable the character "a" to blink when it is clicked upon? Likewise, can the sound "a" also be repeated if needed?
Any advice in this regard will be appreciated.