[Glade-devel] [patch, glade3] wrap widget page in a scrolled window

paolo borelli pborelli@katamail.com
14 Apr 2003 16:03:03 +0200


--=-zdOyJPrL+mmuVsccSwPT
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi!

The patch attached wraps wraps the widget page in the properties editor
into a scrolled window so that it's possible to move down and see all
the properties.

The patch looks rather trivial so I wonder if I'm missing something...

ciao
	paolo

--=-zdOyJPrL+mmuVsccSwPT
Content-Disposition: attachment; filename=editor-scrolled.patch
Content-Type: text/plain; name=editor-scrolled.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

--- gnome2/glade3/src/glade-editor.c	2003-03-30 10:47:07.000000000 +0200
+++ glade3/src/glade-editor.c	2003-04-14 15:43:55.000000000 +0200
@@ -963,6 +963,7 @@ glade_editor_load_widget_page (GladeEdit
 	GladeEditorTable *table;
 	GtkContainer *container;
 	GList *list;
+	GtkWidget *scrolled_window;
 
 	/* Remove the old table that was in this container */
 	container = GTK_CONTAINER (editor->vbox_widget);
@@ -983,8 +984,16 @@ glade_editor_load_widget_page (GladeEdit
 
 	g_return_if_fail (table != NULL);
 	
-	/* Attach the new table */
-	gtk_box_pack_start (GTK_BOX (editor->vbox_widget), table->table_widget,
+	/* wrap the table in a scrolled window */
+	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+					GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
+					       table->table_widget);
+	gtk_viewport_set_shadow_type (GTK_VIEWPORT (GTK_BIN (scrolled_window)->child),
+				      GTK_SHADOW_NONE);
+	gtk_widget_show (scrolled_window);
+	gtk_box_pack_start (GTK_BOX (editor->vbox_widget), scrolled_window,
 			    TRUE, TRUE, 0);
 }
 

--=-zdOyJPrL+mmuVsccSwPT--