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
commit416745896b31e1fdd292df8714ce253a8f10cc9f (patch)
tree3d7ac6e454824827aa1f307ad455379f0cbd082c
parent147112ed71db1db34c1003a4f1c259ef9175d31f (diff)
downloadmdk-416745896b31e1fdd292df8714ce253a8f10cc9f.tar.gz
mdk-416745896b31e1fdd292df8714ce253a8f10cc9f.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)