GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
misc-gnome-utils.c
1 /* Utilities for GTimeTracker - a time tracker
2  * Copyright (C) 2001 Linas Vepstas
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19 
20 #include "config.h"
21 
22 #include <gtk/gtk.h>
23 #include <string.h>
24 
25 #include "misc-gnome-utils.h"
26 
27 /* ============================================================== */
28 
29 void
30 xxxgtk_textview_set_text (GtkTextView *text, const char *str)
31 {
32  GtkTextBuffer *buff = gtk_text_view_get_buffer (text);
33  if (!str) str = "";
34  gtk_text_buffer_set_text (buff, str, strlen (str));
35 
36 }
37 
38 char *
39 xxxgtk_textview_get_text (GtkTextView *text)
40 {
41  GtkTextIter start, end;
42  GtkTextBuffer *buff = gtk_text_view_get_buffer (text);
43  gtk_text_buffer_get_start_iter (buff, &start);
44  gtk_text_buffer_get_end_iter (buff, &end);
45  return gtk_text_buffer_get_text(buff, &start, &end, TRUE);
46 }
47 
48 
49 /* ===================== END OF FILE ============================ */