qulogic/libgnt

Add accessor for GntTextView's text.
release-2.x.y
2019-04-19, Elliott Sales de Andrade
e7ff596b728d
Parents 2ef05b12e0c1
Children 5ebc09ae93a3
Add accessor for GntTextView's text.
--- a/gnttextview.c Fri Apr 19 01:52:27 2019 -0400
+++ b/gnttextview.c Fri Apr 19 02:42:33 2019 -0400
@@ -617,6 +617,14 @@
gnt_widget_draw(widget);
}
+const gchar *
+gnt_text_view_get_text(GntTextView *view)
+{
+ g_return_val_if_fail(GNT_IS_TEXT_VIEW(view), NULL);
+
+ return g_strdup(view->string->str);
+}
+
void gnt_text_view_scroll(GntTextView *view, int scroll)
{
if (scroll == 0)
--- a/gnttextview.h Fri Apr 19 01:52:27 2019 -0400
+++ b/gnttextview.h Fri Apr 19 02:42:33 2019 -0400
@@ -60,7 +60,7 @@
{
GntWidget parent;
- GString *GNTSEAL(string);
+ GString *GNTSEAL(string); /* Deprecated. Use gnt_text_view_get_text. */
GList *GNTSEAL(list); /* List of GntTextLine */
GList *GNTSEAL(tags); /* A list of tags */
@@ -137,6 +137,18 @@
void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag);
/**
+ * gnt_text_view_get_text:
+ * @view: The textview.
+ *
+ * Get the text of the textview.
+ *
+ * Returns: The text.
+ *
+ * Since: 2.14.0
+ */
+const gchar *gnt_text_view_get_text(GntTextView *view);
+
+/**
* gnt_text_view_next_line:
* @view: The textview.
*