Getting text out of a GtkTextView



I have a GtkTextView in one of my application windows; mainly because a
GtkEntry is only single width and I want text wrapping and so forth.

Anyway, I'm trying to get the text from the GtkTextView but only end up
with 'null' when I try to print it. Here is a code snipped:

void insertCustomer( GtkWidget	*customers )
{
	GtkTextBuffer	*specialBuffer;
	GtkTextView		*specialView;
	GtkTextIter		*start;
	GtkTextIter		*end;
	gchar*			*specialText;

    specialView = lookup_widget(customers, "cust_instructions");
	specialBuffer = gtk_text_view_get_buffer(specialView);
	gtk_text_buffer_get_bounds(specialBuffer, start, end);
	specialText = gtk_text_buffer_get_text(specialBuffer, start, end, FALSE);
	g_print("Special Text: %s \n",specialText);
}

I actually want to be able to insert that text into a database field but
it's not working.

Any help is appreciated.

-- 
 .''`.      Carl B. Constantine
: :' :     duckwing duckwing ca
`. `'    GnuPG: 135F FC30 7A02 B0EB 61DB  34E3 3AF1 DC6C 9F7A 3FF8
  `-  Debian GNU/Linux -- The power of freedom

Attachment: pgpLYZrAp888C.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]