I'm new to using GTK. Here is a small section of my code. The aim is to copy the entire current line. The contents are stored in "line". "start" and "end" are textiter at start and end of line.
gtk_text_iter_set_line_offset (start, 0);
gtk_text_iter_forward_to_line_end (end);
line = gtk_text_iter_get_text (start, end);
gtk_clipboard_set_text (clipboard, line, -1);
And upon execution, Im getting the following error messages.
Gtk[27786]: CRITICAL: gtk_text_iter_set_line_offset: assertion 'iter != NULL' failed
Gtk[27786]: CRITICAL: gtk_text_iter_forward_to_line_end: assertion 'iter != NULL' failed
Gtk[27786]: CRITICAL: gtk_text_iter_get_text: assertion 'start != NULL' failed
Gtk[27786]: CRITICAL: gtk_clipboard_set_text: assertion 'text != NULL' failed
What is wrong with the code block? How can i resolve it? Thanks all :)
start
andend
are defined here. – sjsam