Re: [AD] log window

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-07-12, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> On Mon, Jul 12, 2010 at 9:01 AM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> 
> > On 2010-07-05, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > > On Mon, 2010-07-05 at 12:05 +1000, Peter Wang wrote:
> > >
> > > > For non-example uses, we should limit the size of the log.  Probably a
> > > > fixed limit of 1000 lines or so is good enough.
> > > >
> > >
> > > True. Maybe with an unlimited flag since some things can generate a lot
> > > of log lines. My terminal's scrollback buffer is set to 50 000 lines and
> > > I think I still scroll all the way up occasionally and am annoyed when
> > > the initial lines are lost :P
> > >
> > > I wonder if we also should provide functions to clear the buffer or read
> > > back its contents. The latter could be useful especially if we keep the
> > > log window editable. Probably going overboard with this now though.
> > >
> >
> > Do you want to commit this?  (after making the other ports still compile)
> > I can do it if you're busy.
> >
> >
> Earliest I would be able to is Wednesday. If it's committed by then maybe
> I'll see how far I get with a windows or OSX version instead.

Ok, I can do it before then.

> > > +{
> > > +   al_lock_mutex(textlog->text_mutex);
> > > +   /* TODO: If we had an al_ustr_newv which can take the format
> > > +    * parameter and a va_list, it would be easy doing this without a
> > > +    * fixed buffer size...
> > > +    */
> > > +   char text[1024];
> > > +   va_list args;
> > > +   va_start(args, format);
> > > +   vsnprintf(text, sizeof text, format, args);
> > > +   va_end(args);
> > > +   textlog->text = al_ustr_new(text);
> >
> > You can use al_ustr_new and al_ustr_appendf.
> >
> >
> Hm, I don't see how. I would need an al_ustr_appendv. From what I see we
> have nothing which takes a va_list as parameter right now. And I was too
> lazy to check if it would be easy to add.

Oops, I meant al_ustr_vappendf.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/