[Fwd: [gtk-list] Re: GtkText widget]
- From: Gert <gs2 nowmoo demon nl>
- To: gtk-list redhat com
- Subject: [Fwd: [gtk-list] Re: GtkText widget]
- Date: Mon, 14 Jun 1999 23:17:33 +0200
Brett Kosinski wrote:
>
> > > I have noticed the same problem. I thought the problem was in my code.
> > > Is there any way to prevent this? Does any other widget have ability
> > > to show long text? I use text widget to display log messages from
> > > several
> > > applications, and I have limited the buffer size to 10 KB. The buffer
> > > operates with FIFO principle. The widget starts to scroll back and forth
> > > when
> > > the buffer becomes full first time.
> >
> > 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);
>
> 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!
>
> Incidentally, I'm using this technique on an irc program I'm working on,
> so I know it works quite well. :)
>
> 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, 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]