diff src/ui_misc.c @ 1291:50ae02a4a675

replaced bar_info with an universal bar, restored the original functionality (more or less) bar configuration is not yet saved
author nadvornik
date Sat, 14 Feb 2009 19:50:54 +0000
parents 8b89e3ff286b
children 89dedc61b1bd
line wrap: on
line diff
--- a/src/ui_misc.c	Mon Feb 09 09:02:04 2009 +0000
+++ b/src/ui_misc.c	Sat Feb 14 19:50:54 2009 +0000
@@ -1678,4 +1678,34 @@
 
 	return button;
 }
+
+/*
+ *-----------------------------------------------------------------------------
+ * text widget
+ *-----------------------------------------------------------------------------
+ */
+
+gchar *text_widget_text_pull(GtkWidget *text_widget)
+{
+	if (GTK_IS_TEXT_VIEW(text_widget))
+		{
+		GtkTextBuffer *buffer;
+		GtkTextIter start, end;
+
+		buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_widget));
+		gtk_text_buffer_get_bounds(buffer, &start, &end);
+
+		return gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
+		}
+	else if (GTK_IS_ENTRY(text_widget))
+		{
+		return g_strdup(gtk_entry_get_text(GTK_ENTRY(text_widget)));
+		}
+	else
+		{
+		return NULL;
+		}
+
+}
+
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */