Click to See Complete Forum and Search --> : Sliding motion in gtkmm


wtfrara
March 14th, 2009, 05:19 PM
Hi, I'm trying to create a sliding animation for a button in gtkmm on linux. I assumed that I could just called the built in move command for Gtk::Fixed repeatedly with a delay, but unfortunately the delays all merge together.

for example:
for (int i = 25; i <= 100; i+=25) {
move_button(200 + i, 300);
sleep(3);
}

would create a delay at the start of 12 seconds, then move the button once. seems like either the delay isn't working correctly or Gtk::Fixed::move merges together successive moves.

Any ideas?

bitshifter420
March 15th, 2009, 06:36 PM
When working with gui, one should use a timer to perform such motion.
Then you can choose to animate the gui depending on the elapsed time.
This simple method will never allow you programs flow to hang, which is key.