From efcf6058823d4b4c1a0160b5be079c8e84f59813 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 13 Sep 2013 09:53:26 -0700 Subject: [PATCH] Remove deprecated functions in test programs Some of the test programs were using things like GtkHPaned and GtkHButtonBox. --- configure.ac | 2 +- player/preferences.c | 18 ++++++++++++------ tests/test-close.c | 12 ++++++++---- tests/test-multisession.c | 4 ++-- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index fb6bec5..7e72a84 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ LT_VERSION_INFO="$CHIMARA_CURRENT:$CHIMARA_REVISION:$CHIMARA_AGE" AC_SUBST(LT_VERSION_INFO) ### REQUIREMENTS ############################################################## -GTK_REQUIRED_VERSION=3.2 +GTK_REQUIRED_VERSION=3.4 GLIB_REQUIRED_VERSION=2.32 GTK_DOC_REQUIRED_VERSION=1.12 AC_SUBST(GTK_REQUIRED_VERSION) diff --git a/player/preferences.c b/player/preferences.c index a9f5f43..b457c1e 100644 --- a/player/preferences.c +++ b/player/preferences.c @@ -305,17 +305,23 @@ on_toggle_underline(GtkToggleButton *button, ChimaraGlk *glk) { void on_foreground_color_set(GtkColorButton *button, ChimaraGlk *glk) { - GdkColor color; - gtk_color_button_get_color(button, &color); - g_object_set(current_tag, "foreground-gdk", &color, "foreground-set", TRUE, NULL); + GdkRGBA color; + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(button), &color); + g_object_set(current_tag, + "foreground-rgba", &color, + "foreground-set", TRUE, + NULL); } void on_background_color_set(GtkColorButton *button, ChimaraGlk *glk) { - GdkColor color; - gtk_color_button_get_color(button, &color); - g_object_set(current_tag, "background-gdk", &color, "background-set", TRUE, NULL); + GdkRGBA color; + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(button), &color); + g_object_set(current_tag, + "background-rgba", &color, + "background-set", TRUE, + NULL); } void diff --git a/tests/test-close.c b/tests/test-close.c index 1e0266e..8f902e6 100644 --- a/tests/test-close.c +++ b/tests/test-close.c @@ -41,10 +41,14 @@ main(int argc, char *argv[]) window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(window), 400, 400); g_signal_connect(window, "delete-event", G_CALLBACK(gtk_main_quit), NULL); - vbox = gtk_vbox_new(FALSE, 6); + vbox = gtk_grid_new(); + gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL); + gtk_grid_set_row_spacing(GTK_GRID(vbox), 6); glk = chimara_if_new(); + gtk_widget_set_hexpand(glk, TRUE); + gtk_widget_set_vexpand(glk, TRUE); //g_signal_connect(glk, "command", G_CALLBACK(on_command), window); - hbox = gtk_hbutton_box_new(); + hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL); stop = gtk_button_new_with_label("Stop"); g_signal_connect(stop, "clicked", G_CALLBACK(on_stop), glk); go = gtk_button_new_with_label("Go"); @@ -52,8 +56,8 @@ main(int argc, char *argv[]) gtk_box_pack_start(GTK_BOX(hbox), stop, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), go, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), glk, TRUE, TRUE, 0); + gtk_container_add(GTK_CONTAINER(vbox), hbox); + gtk_container_add(GTK_CONTAINER(vbox), glk); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show_all(window); diff --git a/tests/test-multisession.c b/tests/test-multisession.c index 57c67ab..a364bf7 100644 --- a/tests/test-multisession.c +++ b/tests/test-multisession.c @@ -33,8 +33,8 @@ main(int argc, char **argv) GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request(window, 800, 500); g_signal_connect(window, "delete_event", G_CALLBACK(on_delete_event), NULL); - - GtkWidget *hpaned = gtk_hpaned_new(); + + GtkWidget *hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL); gtk_paned_set_position(GTK_PANED(hpaned), 400); GtkWidget *frotz = chimara_glk_new(); -- 2.30.2