gtktext questions



Greetings everyone,

I have a program that outputs a fair amout of text into a gtk text widget. When the contents of the text 
widget go over a specified limit, the program calls gtk_text_freeze, copies the contents of the window, 
strips out the oldest entries, and then writes the text back to the window. This works fine, accept that I 
need to call gtk_adjustment_set_value to set the scrollbar at the bottom, which seems to cause some flicker. 
Since you cannot call gtk_adjustment_set_value while the text widget is frozen (correct?), you can't avoid 
the flicker. For example:

gtk_text_freeze(...

wcontents = gtk_editable_get_chars(....
chars = gtk_text_get_length(....

if (chars > limit) {
      ...
      <strip out old text>
      ...
      gtk_editable_delete_text(....    
      gtk_editable_insert_text(gtktext, striped.....   
   }

gtk_text_thaw(...

gtk_adjustment_set_value(...


In short, what is the best way to limit the size of a gtktext widget while keeping it snapped to the bottom 
and minimizing the flicker. 

Is this issue resloved in the gtktext widget in the devel branch?

Would the gtkextext widget solve this problem?

Thanks in advance...




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