Re: gtk geometry and child aspect ratio?



Owen Taylor wrote:
On Sun, 2004-02-08 at 14:10, Johan Knol wrote:

Hi, this may be a newbe question, but it drives me crazy ;(

A very simple app (using glade):

- window1
-- vbox1
--- scrolledwindow1
---- drawingarea1
--- statusbar1

Now I want drawingarea1 to be squared, so:

void
on_drawingarea1_realize (GtkWidget *widget, gpointer user_data)
{
  GdkGeometry geometry;

  geometry.min_aspect = geometry.max_aspect = 1.0;
gtk_window_set_geometry_hints (window1, widget, &geometry, GDK_HINT_ASPECT);
}

But this squares *window1*, not the *drawingarea1*, which was passed on as the geometry_widget ;(.
Any help would be greatly apreciated.


The geometry widget handling is unfortunately fairly broken currently.

http://bugzilla.gnome.org/show_bug.cgi?id=68668

has some details. To see how hacking around the limitations work in
practice, see the source-code to gnome-terminal. But I'm not
really sure how you expect it to work with the scrolled window
inbetween the toplevel and the geometry widget. The scrolled
window isolates the drawing area from toplevel resizing, so a
square drawing area shouldn't put any constraints on the toplevel.

Ok, I want the geometry manager to display the visual part of the drawing area to be squared. So maybe I should use the scrolledwindow's viewport as the geometry widget, but that doesn't work either.

Thanks,
Johan




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