Re: Dialog with aspect ration won't resize (win32/mingw)



Guess you found a bug in the win32 port of gtk+. See the attached
example. I would recommend you submit a bug report to the gtk+ bugzilla.
Or I can also do it for you if you prefer...

Cedric

Vladislav Grinchenko wrote:

> In my other posting ("Can't enforce ..." hit the 'send' button
> prematurely), I supplied a modification to the demo dialog code that
> illustrated the ratio problem. Can you, please, compile it on your
> installation and tell me if you can resize it?
#include <gtk/gtk.h>

static gboolean delete_event(GtkWidget *widget,GdkEvent *event,gpointer data)
{
  gtk_main_quit ();
  return FALSE;
}

int main( int   argc,
          char *argv[] )
{
  GtkWidget *window;
  GtkWidget *label;
  
  gtk_init(&argc, &argv);
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  g_signal_connect(G_OBJECT (window), "delete_event",
		   G_CALLBACK (delete_event), NULL);
  
  label = gtk_label_new("Hello World");
  gtk_container_add(GTK_CONTAINER (window), label);

  gint width  = 200;
  gint height = 122;
  gdouble aspect = width * 1.0 / height;

  GdkGeometry box_geometry = { 
    width, /* min_width */      height, /* min_height */
    -1,	   /* max_width; */	-1,	/* max_height  */
    width, /* base_width */	height,	/* base_height */
    1,	   /* width_inc  */	1,	/* height_inc  */
    aspect,	                        /* min_aspect (width/height) */
    aspect	                        /* max_aspect (width/height) */
  };
  
  gtk_window_set_geometry_hints(GTK_WINDOW(window), window,
				&box_geometry, 
				GDK_HINT_ASPECT | GDK_HINT_MIN_SIZE);
  
  gtk_widget_show(label);
  gtk_widget_show(window);
  
  gtk_main();
  
  return 0;
}


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