comparison src/gtkrequest.c @ 7538:357eb1c39b72

[gaim-migrate @ 8151] Robot101 made a nice patch (which I modified just slightly) to put our gtkspell attachment function that we use all throughout gaim into a utility function, which handles error checking and only does anything if gtkspell support is compiled in. It lets us remove a lot of #ifdef USE_GTKSPELL from places, and doesn't change any functionality. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 17 Nov 2003 06:48:01 +0000
parents 7c320cdc0f3a
children cf6a7939af78
comparison
equal deleted inserted replaced
7537:083427fd8ba8 7538:357eb1c39b72
28 #include "gtkrequest.h" 28 #include "gtkrequest.h"
29 #include "gtkutils.h" 29 #include "gtkutils.h"
30 #include "stock.h" 30 #include "stock.h"
31 #include "ui.h" 31 #include "ui.h"
32 32
33 #ifdef USE_GTKSPELL
34 # include <gtkspell/gtkspell.h>
35 # ifdef _WIN32
36 # include "wspell.h"
37 # endif
38 #endif
39
40 typedef struct 33 typedef struct
41 { 34 {
42 GaimRequestType type; 35 GaimRequestType type;
43 36
44 void *user_data; 37 void *user_data;
305 298
306 entry = gtk_text_view_new(); 299 entry = gtk_text_view_new();
307 gtk_text_view_set_editable(GTK_TEXT_VIEW(entry), TRUE); 300 gtk_text_view_set_editable(GTK_TEXT_VIEW(entry), TRUE);
308 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(entry), GTK_WRAP_WORD_CHAR); 301 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(entry), GTK_WRAP_WORD_CHAR);
309 302
310 #ifdef USE_GTKSPELL
311 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck")) 303 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck"))
312 gtkspell_new_attach(GTK_TEXT_VIEW(entry), NULL, NULL); 304 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(entry));
313 #endif
314 305
315 gtk_container_add(GTK_CONTAINER(sw), entry); 306 gtk_container_add(GTK_CONTAINER(sw), entry);
316 307
317 if (default_value != NULL) { 308 if (default_value != NULL) {
318 GtkTextBuffer *buffer; 309 GtkTextBuffer *buffer;
646 gtk_text_view_set_editable(GTK_TEXT_VIEW(textview), 637 gtk_text_view_set_editable(GTK_TEXT_VIEW(textview),
647 TRUE); 638 TRUE);
648 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(textview), 639 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(textview),
649 GTK_WRAP_WORD_CHAR); 640 GTK_WRAP_WORD_CHAR);
650 641
651 #ifdef USE_GTKSPELL
652 if (gaim_prefs_get_bool( 642 if (gaim_prefs_get_bool(
653 "/gaim/gtk/conversations/spellcheck")) 643 "/gaim/gtk/conversations/spellcheck"))
654 { 644 {
655 gtkspell_new_attach(GTK_TEXT_VIEW(textview), 645 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(textview));
656 NULL, NULL);
657 } 646 }
658 #endif
659 647
660 gtk_container_add(GTK_CONTAINER(widget), textview); 648 gtk_container_add(GTK_CONTAINER(widget), textview);
661 gtk_widget_show(textview); 649 gtk_widget_show(textview);
662 650
663 gtk_widget_set_size_request(widget, -1, 75); 651 gtk_widget_set_size_request(widget, -1, 75);