add misc gnome textbox utils

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8931 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas
2003-07-26 14:48:25 +00:00
parent 029dfc92f8
commit 02453a0eeb
3 changed files with 73 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ libgncmod_gnome_utils_la_SOURCES = \
gnc-query-list.c \
gncmod-gnome-utils.c \
gtkselect.c \
misc-gnome-utils.c \
print-session.c \
search-param.c \
window-help.c
@@ -85,6 +86,7 @@ gncinclude_HEADERS = \
gnc-menu-extensions.h \
gnc-query-list.h \
gtkselect.h \
misc-gnome-utils.h \
print-session.h \
window-help.h

View File

@@ -0,0 +1,43 @@
/* Utilities for GTimeTracker - a time tracker
* Copyright (C) 2001 Linas Vepstas
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <gnome.h>
#include "misc-gnome-utils.h"
/* ============================================================== */
void
xxxgtk_text_set_text (GtkText *text, const char *str)
{
gint pos=0;
if (!str) str = "";
gtk_editable_delete_text (GTK_EDITABLE (text), 0, -1);
gtk_editable_insert_text (GTK_EDITABLE (text), str,
strlen(str), &pos);
}
const char *
xxxgtk_text_get_text (GtkText *text)
{
return gtk_editable_get_chars (GTK_EDITABLE(text), 0, -1);
}
/* ===================== END OF FILE ============================ */

View File

@@ -0,0 +1,28 @@
/* utilities for GTimeTracker - a time tracker
* Copyright (C) 2001 Linas Vepstas
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __GTT_UTIL_H__
#define __GTT_UTIL_H__
#include <gtk/gtktext.h>
/* Some gtk-like utilities */
void xxxgtk_text_set_text (GtkText *text, const char *str);
const char * xxxgtk_text_get_text (GtkText *text);
#endif /* __GTT_UTIL_H__ */