Re: drawing in a for-loop



Ian Strascina ha scritto lo scorso 24/02/2005 23:18:

OK, this is probably the stupidest post ever, but I need help drawing in a for-loop within a callback function... I've done this before, but for some reason, I'm not getting expose events to refresh my GtkDrawingArea... My code looks like this (using gtkmm, but doesn't matter)...


void mainWindow::button_callback()
{
  //GtkDrawingArea is called '* area'
  width = GTK_WIDGET(area)->allocation.width;
  height = " " ".height;

  for (int i=0; i<200; i++)
  {
    gdk_draw_point(this->pixmap,GTK_WIDGET(area)->style->black_gc,i,i);
    gtk_widget_queue_draw_area((GtkWidget *) area,0,0,width,height);
      while (gtk_events_pending ())
      {
        gtk_main_iteration ();
      }
    delay-for-a-split-second();
  }
}
[..]



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