summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-06-15 20:37:31 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-06-15 20:37:31 +0000
commitd527558332306ab90c5bb8fce47c231a676c4447 (patch)
tree519a2c67f959bcd81bf2d86073d7ce4c0f9fcbb6
parentc443fd3cb08ea7665522ca23bd26ef2c60284015 (diff)
downloadmdk-d527558332306ab90c5bb8fce47c231a676c4447.tar.gz
mdk-d527558332306ab90c5bb8fce47c231a676c4447.tar.bz2
font config bug fixed
-rw-r--r--mixgtk/mixgtk_fontsel.c15
1 files 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)