[gnome-video-arcade] Avoid deprecated GLib/GTK+ APIs.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-video-arcade] Avoid deprecated GLib/GTK+ APIs.
- Date: Thu, 23 Jun 2011 00:09:50 +0000 (UTC)
commit ba797eddc8d7887c5c76040f1fae2a10d03e5f48
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon May 30 08:36:21 2011 -0400
Avoid deprecated GLib/GTK+ APIs.
src/gva-input-file.c | 2 +-
src/gva-properties.c | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/gva-input-file.c b/src/gva-input-file.c
index f72f47a..314b0e5 100644
--- a/src/gva-input-file.c
+++ b/src/gva-input-file.c
@@ -518,7 +518,7 @@ exit:
}
if (mapped_file != NULL)
- g_mapped_file_free (mapped_file);
+ g_mapped_file_unref (mapped_file);
return success;
}
diff --git a/src/gva-properties.c b/src/gva-properties.c
index 832b2ee..a9733cd 100644
--- a/src/gva-properties.c
+++ b/src/gva-properties.c
@@ -766,11 +766,9 @@ gva_properties_init (void)
{
GtkTreeView *view;
GSettings *settings;
- GtkSettings *gtk_settings;
+ GtkStyleContext *context;
GtkWidget *text_view;
- GHashTable *color_hash;
PangoFontDescription *desc;
- const GdkColor *color;
GtkWidget *widget;
gchar *font_name;
@@ -806,15 +804,16 @@ gva_properties_init (void)
font_name = gva_get_monospace_font_name ();
desc = pango_font_description_from_string (font_name);
- gtk_widget_modify_font (text_view, desc);
+ gtk_widget_override_font (text_view, desc);
pango_font_description_free (desc);
g_free (font_name);
- gtk_settings = gtk_settings_get_default ();
- g_object_get (gtk_settings, "color-hash", &color_hash, NULL);
- color = g_hash_table_lookup (color_hash, "tooltip_bg_color");
widget = GVA_WIDGET_PROPERTIES_STATUS_FRAME;
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_WARNING);
+ widget = gtk_bin_get_child (GTK_BIN (widget));
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_WARNING);
#ifndef HAVE_GSTREAMER
gtk_widget_hide (GVA_WIDGET_PROPERTIES_MUSIC_TABLE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]