From 3fb40e7713e33a034632386a1446e3d94b25e6a5 Mon Sep 17 00:00:00 2001 From: Ales Hvezda Date: Fri, 4 Jan 2008 13:30:26 -0500 Subject: [PATCH] Added refresh button to the in-use tab in the component selection dialog The refresh button refresh the in-use component list as well as the library component list. Before this patch, the refresh button was only in the library tab and not accessible from the in-use tab. --- gschem/src/x_compselect.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c index 1ab795a62..91852c845 100644 --- a/gschem/src/x_compselect.c +++ b/gschem/src/x_compselect.c @@ -719,7 +719,7 @@ compselect_callback_refresh_library (GtkButton *button, gpointer user_data) static GtkWidget* create_inuse_treeview (Compselect *compselect) { - GtkWidget *scrolled_win, *treeview; + GtkWidget *scrolled_win, *treeview, *vbox, *hbox, *button; GtkTreeModel *model; GtkTreeSelection *selection; GtkCellRenderer *renderer; @@ -727,6 +727,14 @@ create_inuse_treeview (Compselect *compselect) model = create_inuse_tree_model (compselect); + vbox = GTK_WIDGET (g_object_new (GTK_TYPE_VBOX, + /* GtkContainer */ + "border-width", 5, + /* GtkBox */ + "homogeneous", FALSE, + "spacing", 5, + NULL)); + /* Create a scrolled window to accomodate the treeview */ scrolled_win = GTK_WIDGET ( g_object_new (GTK_TYPE_SCROLLED_WINDOW, @@ -776,7 +784,38 @@ create_inuse_treeview (Compselect *compselect) /* set the inuse treeview of compselect */ compselect->inusetreeview = GTK_TREE_VIEW (treeview); - return scrolled_win; + /* add the scrolled window for directories to the vertical box */ + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, + TRUE, TRUE, 0); + + /* -- refresh button area -- */ + hbox = GTK_WIDGET (g_object_new (GTK_TYPE_HBOX, + /* GtkBox */ + "homogeneous", FALSE, + "spacing", 3, + NULL)); + /* create the refresh button */ + button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON, + /* GtkWidget */ + "sensitive", TRUE, + /* GtkButton */ + "relief", GTK_RELIEF_NONE, + NULL)); + gtk_container_add (GTK_CONTAINER (button), + gtk_image_new_from_stock (GTK_STOCK_REFRESH, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + /* add the refresh button to the horizontal box at the end */ + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + g_signal_connect (button, + "clicked", + G_CALLBACK (compselect_callback_refresh_library), + compselect); + + /* add the refresh button area to the vertical box */ + gtk_box_pack_start (GTK_BOX (vbox), hbox, + FALSE, FALSE, 0); + + return vbox; } /*! \brief Creates the treeview for the "Library" view */ -- 2.11.4.GIT