Re: Writing science application to visualisate physical process. Need help.



Hi

If you want to use static images and want to move them, look at the
gdk-pixbuf API. For an examples see the gtk+ source (demos/gtk-demo).

GtkImage should be used for static images, GtkDrawingArea for dynamic ones
(like your movie).

There isn't enought code to say what's wrong. If you code is in a loop,
you won't see any moving, because Gtk+ has no time to update the window.

Based on the scribble-simple.c

gboolean my_idle( gpointer data )
{
  if( pixmap == NULL )
     return TRUE;

//  Your drawing here

  gtk_widget_queue_draw_area(...);
  return TRUE;
}

void main(...)
{
  ...

  g_idle_add( my_idle );
  gtk_main();
}

HTH

Jan-Marek

P.S. In your code it may be enought to add

  while (gtk_events_pending ())
          gtk_main_iteration ();

after the gtk_widget_queue_draw_area, so Gtk+ can process the drawing
request - that's just a guess



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]