From d527558332306ab90c5bb8fce47c231a676c4447 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Fri, 15 Jun 2001 20:37:31 +0000 Subject: font config bug fixed --- mixgtk/mixgtk_fontsel.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mixgtk/mixgtk_fontsel.c b/mixgtk/mixgtk_fontsel.c index 16b6ba1..0e7712d 100644 --- a/mixgtk/mixgtk_fontsel.c +++ b/mixgtk/mixgtk_fontsel.c @@ -34,7 +34,7 @@ typedef struct winfo { GtkWidget *widget; GtkStyle *style; - const gchar *font; + gchar *font; const gchar *key; } winfo; @@ -83,6 +83,7 @@ void mixgtk_fontsel_load_defaults (void) { int i; + const gchar *font = NULL; winfo_ = g_hash_table_new (NULL, NULL); for (i = 0; i < WIDGET_NO_; ++i) { @@ -99,13 +100,12 @@ mixgtk_fontsel_load_defaults (void) infos_[i].style); } infos_[i].key = keys_[i]; - infos_[i].font = mixgtk_config_get (keys_[i]); g_hash_table_insert (winfo_, GINT_TO_POINTER (widget_ids_[i]), (gpointer)(infos_ + i)); - if (infos_[i].font) - { - mixgtk_fontsel_set (widget_ids_[i], infos_[i].font); - } + + infos_[i].font = NULL; + font = mixgtk_config_get (keys_[i]); + if (font) mixgtk_fontsel_set (widget_ids_[i], font); } } @@ -121,7 +121,8 @@ mixgtk_fontsel_set (mixgtk_widget_id_t widget, const gchar *font) { gdk_font_unref (w->style->font); w->style->font = f; - w->font = font; + if (w->font) g_free (w->font); + w->font = g_strdup (font); gtk_widget_draw (w->widget, NULL); if (widget == MIXGTK_WIDGET_MIXVM) -- cgit v1.2.3