Re: GtkDrawingArea in a GtkFrame

"David F. Newman" <dnewman maraudingpirates org> writes: 
gint expose_event_cb(GtkWidget *w, GdkEventExpose *e)
  GtkRequisition req;

  /* Get the size of the Map Widget */
  gtk_widget_size_request (w, &req);
  printf("Map = %dx%d\n", req.width, req.height);

Here is your problem. size_request gets the requested size of the
drawing area, which doesn't change; you want the actual size of the
drawing area, which is widget->allocation.width,
widget->allocation.height, i.e. the size allocation.

i.e. the size request is what the drawing area asked for (in effect
its minimum size), and the allocation is what it actually ends up


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