Redrawing a widget



Hi, i'm working on an OpenGL project using GTK+ & GtkGLArea. My question
is... how can i force a widget to be redraw? Not by an expose event, but at
anytime.
A simple example, suppose i want to clear the widget contents, call the
glClear function and then i call gtk_widget_draw passing the widget and the
area i want to be redraw, but it doesn't work.. is this a problem with
OpenGL code or GTK+ one?? I mean.. Is gtk_widget_draw the correct way to
redraw any kind of widget?

Here is an example code:

  GdkRectangle area;
  area.x = 0;
  area.y = 0;
  area.width  = _glarea->allocation.width;
  area.height = _glarea->allocation.height;

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  gtk_widget_draw(_glarea, &area);
  g_print("Cleared Rectangle:(%d,%d)
(%d,%d)\n",area.x,area.y,area.width,area.height);



Ignacio Nodal





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