Re: [gtk-list] Re: GtkText widget



Brett Kosinski wrote:
> 
> > You could use the GtkList widget, and add/remove line for line (don't know
> > if that widget has the same problem as the GtkText thought).
> > I can't use it, because I need color and stuff ... (MOO/MUD output)
> 
> Actually, what you can do is this:  do a gtk_text_freeze() to freeze the
> text box and add all your text.  Then, use this little code snippet:
> 
> GtkAdjustment *vadj = GTK_ADJUSTMENT(GTK_TEXT(textbox)->vadj);
> 
> gtk_adjustment_set_value(GTK_ADJUSTMENT(vadj),
>                          GTK_ADJUSTMENT(vadj)->upper -
>                          GTK_ADJUSTMENT(vadj)->page_size);

How else would you get the window down to where it was ?

> And then gtk_text_thaw() the widget.  This might take a little
> modification to make it work (I wrote it on the fly, converting it from
> some Perl/GTK code of mine :) but you see the idea.  Basically, after
> appending the item, you scroll the widget to the bottom of the list by
> scrolling to the upper limit of the list minus the page size.  Enjoy!

Freeze()ing and Thaw()ing makes the whole thing flicker like hell :(, I tried
that ..
 
> Incidentally, I'm using this technique on an irc program I'm working on,
> so I know it works quite well. :)

And the flicker ?

> Brett.
> 
> PS  Could you please post this to the Gtk-List as well... for some reason
> I've been unsubscribed from it (which is why I didn't post in the first
> place). :)


Gert

-- 
-------------------------------------------------------------------------------
   ~     Gert, Gs2, The Blue Mage - whatever you prefer
  'v'    E-Mail   : Gs2@dds.nl
 // \\    Computer : nowmoo.demon.nl
/(   )\  Project  : gMOO, a MOO (and MUD) client for the unises
 ^`~'^   HomePage : http://www.nowmoo.demon.nl



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