Re: Difference between Gtk2 and Gtk3 output



Thanks!

Looks like somehow the scrolled_window widget messes up its dimensions.

Using size_request: 

  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
  gtk_widget_set_size_request(viewport,400,150);  
  gtk_widget_set_size_request(swin,400,150);  
  gtk_box_pack_start(GTK_BOX (vbox), viewport, TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX (vbox), swin,     TRUE, TRUE, 0);

Results in: http://img703.imageshack.us/img703/3624/scrolledwindowsizereque.png

With other words only swin's height is honoured (its width not). The viewport requests are neglected.

Using set_ homogeneous as in:
 
  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
  gtk_box_set_homogeneous(GTK_BOX (vbox),TRUE);
  gtk_box_pack_start(GTK_BOX (vbox), viewport, TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX (vbox), swin,     TRUE, TRUE, 0);

results in both viewport and scrolled swin widgets to be expanded vertically so the top window encompasses them both (which makes the use of a scrollbar and viewport useless).

Putting viewport and swin in a hbox first does not help; swin's height is again only one row (and full width). Using size_request on the hboxes results in the same figure as shown above.

The paned version:

  vbox = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
  gtk_paned_pack1(GTK_PANED (vbox), viewport, TRUE, TRUE);
  gtk_paned_pack2(GTK_PANED (vbox), swin,     TRUE, FALSE);

Results in: http://img203.imageshack.us/img203/3716/scrolledwindowpanedgtk3.png

The width is again around 600 pixels. And if one labels each button individually (as has been done in the picture) it is clear that after panning the top rows of the viewport are inaccessible.

The Gtk2 version is so easy and simple to understand; it cannot be that a similar Gtk3 version is so difficult to obtain.

Regards




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