How does one set background color for entire line in textview?
- From: Tony Freeman <tony freeman insightbb com>
- To: gtk-app-devel-list gnome org
- Subject: How does one set background color for entire line in textview?
- Date: Mon, 15 Jan 2007 15:06:46 -0500
Hello,
I have a function that takes the output of a spawned process and
displays that in a text buffer (part of a notebook widget). When the
spawned process is finished, I'd like to put some colorized text at the
bottom of the text buffer/view that alerts the user that the process is
done.
What I want is the entire line to have a background color of blue. The
code that I have so far just displays the blue background under the
text.
How do I make the entire line blue?
switch (status) {
case G_IO_STATUS_NORMAL:
return TRUE;
default:
/* Use a tag to make the DONE notification noticeable */
tag = gtk_text_buffer_create_tag (
buffer, "done_notification",
"foreground", "white",
"background", "blue",
"justification", GTK_JUSTIFY_CENTER,
"background-full-height", TRUE,
NULL);
start_byte = gtk_text_buffer_get_char_count(buffer);
gtk_text_buffer_insert(buffer, &iter,
"\n----------\nDONE\n----------\n", -1);
end_byte = gtk_text_buffer_get_char_count(buffer);
gtk_text_buffer_get_iter_at_offset (buffer,
&start, start_byte);
gtk_text_buffer_get_iter_at_offset (buffer,
&end, end_byte);
gtk_text_buffer_apply_tag (buffer, tag, &start, &end);
end_mark = gtk_text_buffer_create_mark(
buffer, "end_mark", &end, FALSE);
gtk_text_view_scroll_to_mark(textview, end_mark,
0.0, FALSE, 0.0, 0.0);
return FALSE;
}
-- Tony
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]