Re: [gnotepad-users] Fix patch for 1.3.0
Brought to you by:
ackahn
From: Andy K. <ac...@ne...> - 2000-06-14 18:04:43
|
Yoichi, On Wed, Jun 14, 2000 at 07:44:28PM +0900, Yoichi ASAI wrote: > I found the "Sample Output" (that is in "Fonts and Colors" tab > in the preferences panel) does not reflect font setting on the > startup. > > This problem comes out when gnotepad+ is compiled with libglade. That's odd; this doesn't happen on my end. > --- src/prefs.c.orig Wed Apr 19 10:28:59 2000 > +++ src/prefs.c Thu May 11 21:24:33 2000 > @@ -2736,7 +2736,6 @@ > > #if defined(GTK_HAVE_FEATURES_1_1_0) && !defined(USE_LIBGLADE) > /* update the prefs window's text widget and insert sample text */ > - prefs_update_text_widget_style(prefs_txt); > gtk_text_set_editable(GTK_TEXT(prefs_txt), FALSE); > gtk_text_set_word_wrap(GTK_TEXT(prefs_txt), TRUE); > gtk_widget_realize(prefs_txt); > @@ -2747,6 +2746,7 @@ > "1.2.x, but not 1.0.x.", > -1); > #endif > + prefs_update_text_widget_style(prefs_txt); > gtk_widget_show_all(prefs_win); > gtk_events_flush(); Upon looking at the code, I can see why the problem might occur (even though it doesn't on my system). However, I think the solution is to set the text widget style a little earlier, since if it isn't compiled with libglade, the style should be set before inserting any new text. Here's a slightly modified patch: --- prefs.c.ORIG Tue Apr 18 18:28:59 2000 +++ prefs.c Wed Jun 14 11:02:47 2000 @@ -2734,9 +2734,9 @@ CANCEL_DEFAULT | GRAB_DEFAULT, 0); #endif /* USE_GNOME */ -#if defined(GTK_HAVE_FEATURES_1_1_0) && !defined(USE_LIBGLADE) /* update the prefs window's text widget and insert sample text */ prefs_update_text_widget_style(prefs_txt); +#if defined(GTK_HAVE_FEATURES_1_1_0) && !defined(USE_LIBGLADE) gtk_text_set_editable(GTK_TEXT(prefs_txt), FALSE); gtk_text_set_word_wrap(GTK_TEXT(prefs_txt), TRUE); gtk_widget_realize(prefs_txt); Let me know how this works for you. --andy |