Re: GtkDrawingArea in a GtkFrame
- From: Havoc Pennington <hp redhat com>
- To: "David F. Newman" <dnewman maraudingpirates org>
- Cc: <gtk-app-devel-list gnome org>
- Subject: Re: GtkDrawingArea in a GtkFrame
- Date: 09 Oct 2001 23:37:58 -0400
"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
with.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]