comparison src/gtk/view_dialog.c @ 588:2366865be140

2004-10-5 Brian Masney <masneyb@gftp.org> * src/gtk/menu-items.c (dosavelog, viewlog) - make sure the entire log is written out when multibyte characters are used * src/gtk/view_dialog.c - small improvements to the way text is inserted in the gtk+ 2.x port
author masneyb
date Wed, 06 Oct 2004 02:32:41 +0000
parents 739afd9df73c
children fa0838b22b14
comparison
equal deleted inserted replaced
587:7937ade77c22 588:2366865be140
253 int doclose; 253 int doclose;
254 ssize_t n; 254 ssize_t n;
255 #if GTK_MAJOR_VERSION > 1 255 #if GTK_MAJOR_VERSION > 1
256 GtkTextBuffer * textbuf; 256 GtkTextBuffer * textbuf;
257 GtkTextIter iter; 257 GtkTextIter iter;
258 guint len;
259 #endif 258 #endif
260 259
261 doclose = 1; 260 doclose = 1;
262 stlen = strlen (filename); 261 stlen = strlen (filename);
263 gftp_lookup_global_option ("ext", &tmplistvar); 262 gftp_lookup_global_option ("ext", &tmplistvar);
421 buf[n] = '\0'; 420 buf[n] = '\0';
422 #if GTK_MAJOR_VERSION == 1 421 #if GTK_MAJOR_VERSION == 1
423 gtk_text_insert (GTK_TEXT (view), NULL, NULL, NULL, buf, -1); 422 gtk_text_insert (GTK_TEXT (view), NULL, NULL, NULL, buf, -1);
424 #else 423 #else
425 textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); 424 textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
426 len = gtk_text_buffer_get_char_count (textbuf); 425 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, -1);
427 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, len); 426 gtk_text_buffer_insert (textbuf, &iter, buf, -1);
428 gtk_text_buffer_insert (textbuf, &iter, buf, n);
429 #endif 427 #endif
430 } 428 }
431 429
432 if (doclose) 430 if (doclose)
433 close (fd); 431 close (fd);