Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3789564
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:10:37+00:00 2026-05-19T12:10:37+00:00

I’m going to write a simple animation in XPCE ( four glasses puzzle to

  • 0

I’m going to write a simple animation in XPCE (four glasses puzzle to be precise). I know absolutely nothing about XPCE so I looked up a tutorial but the results are disappointing. Could anyone point me to some materials on the following:

  • working with a “canvas”
  • animation
  • timers

EDIT: Okay, here’s a more detailed problem: I want to draw two boxes, wait two seconds, hide the boxes, then start a timer.

new(@box1, box(100,100)),
send(W, display, @box1),
new(@box2, box(100,100)),
send(W, display, @box2, point(200, 200)),

% wait two seconds here
% hide the boxes here

new(Msg1, and(message(B1, relative_move, point(5, 0)),
              message(B4, relative_move, point(0, 5)))),
send(W, attribute, attribute(timer, new(T, timer(0.1, Msg1)))),

send(T, start),

EDIT 2: Okay, here is another question (should I open a new question?): This is the code I’m using:

get_file(0, 'glass.gif').
get_file(180, 'glass180.gif').

main(GA, GB, GC, GD) :- % e.g. main(0,0,180,0).
    new(B1, figure),
    get_file(GA, G1),
    send(B1, display, new(BM1, bitmap(G1))),
    send(BM1, transparent, @on),
    send(W, display, B1, point(0,0)),     

%analogically for the other three glasses

I’d like to set a new bitmap for B1. How do I do that? Would altering BM1 be enough? Or perhaps there is an alternative solution? I’ve been thinking about drawing both upright and reversed glasses off-screen and swapping them, but I’m not sure about the details of such solution.

EDIT2′: Solved it. For posterity:

send(B1, clear),
send(B1, display, bitmap('glass_while_animating_1.gif')),
send(timer(0.1), delay),
send(B1, clear),
send(B1, display, bitmap('glass_while_animating_2.gif')),
% etc
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:10:38+00:00Added an answer on May 19, 2026 at 12:10 pm

    Would this searchable pdf be of help?

    link text

    “Chapter 5. Simple graphics” talks about a picture (ie. a canvas).

    On page 260 there’s an example of using a timer to introduce a delay, and page 266 shows using a timer for a blinking graphical.

    On page 40 there’s a mention of utilizing ‘graphical->flush’ to explicitly force redraw right now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.