Invisible text in a GtkTextView
- From: Neoklis Kyriazis <neoklisk cytanet com cy>
- To: GTK mailing list <gtk-app-devel-list gnome org>
- Subject: Invisible text in a GtkTextView
- Date: Sun, 5 Jan 2003 20:17:47 +0200
Hi all
I have almost completed my first GTK+ app using Glade-2 but I am stuck
with a final problem re. text written to a GtkTextView remaining
invisible sometimes. My app uses idle callback functions to read blocks
of data from the sound card and this is done by a blocking read()
at intervals of about 1/2 sec. The idle callbacks return TRUE after each
block of data is read so that control does reach gtk_main() but written
text remains invisible until reading is stopped. However, scrolling the
text viewer up-down reveals the written text. Additionally, coloring of
the text sometimes is incorrect, eg text with red attr apeears normal
black but scrolling again usually corrects the color.
I am using the following code to write text and scroll the viewer so
that it always shows the last lines written:
  /* Print message */
  gtk_text_buffer_insert_with_tags_by_name( gbl_text_buffer, &iter, 
                                            message, -1, attr, NULL);
  /* Scroll Text View to bottom */
  adjustment = gtk_scrolled_window_get_vadjustment
    ( GTK_SCROLLED_WINDOW(gbl_text_scroller) );
  gtk_adjustment_set_value( adjustment, adjustment->upper );
Any advice on this greately appreciated!
My thanks in advance.
-- 
Regards      My Ham Radio callsign: 5B4AZ  QTH Loc: KM64MR
             My website (with some Ham Radio/Linux software):
Neoklis      http://www.qsl.net/5b4az/
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]