X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-output-view.c;h=ce29472e87095ee6f562b510f133ac5c8a8ee6e3;hb=d9d46e3c7ef1a275f57bf9f8ad3e47231d6fb58c;hp=08daef95bf39cf6821c27f68b760a361fb2c4231;hpb=7293c1a383d325c371bd708401e5a1d7586a4d90;p=pspp diff --git a/src/ui/gui/psppire-output-view.c b/src/ui/gui/psppire-output-view.c index 08daef95bf..ce29472e87 100644 --- a/src/ui/gui/psppire-output-view.c +++ b/src/ui/gui/psppire-output-view.c @@ -250,11 +250,23 @@ rerender (struct psppire_output_view *view) gtk_layout_move (view->output, item->drawing_area, xpos, view->y); } + { + gint minw; + gint minh; + /* This code probably doesn't bring us anthing, but Gtk + shows warnings if get_preferred_width/height is not + called before the size_allocate below is called. */ + gtk_widget_get_preferred_width (item->drawing_area, &minw, NULL); + gtk_widget_get_preferred_height (item->drawing_area, &minh, NULL); + if (th > minh) th = minh; + if (tw > minw) tw = minw; + } alloc.x = xpos; alloc.y = view->y; alloc.width = tw; alloc.height = th; - gtk_widget_size_allocate(item->drawing_area,&alloc); + + gtk_widget_size_allocate (item->drawing_area, &alloc); if (view->max_width < tw) view->max_width = tw;