[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2010-07-04, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> On Fri, 2010-07-02 at 10:54 +0200, Elias Pschernig wrote:
> >
> > The log window seems like a good idea though since also in OSX and Linux
> > printfs aren't always visible. I can make the GTK version of it.
> >
>
> I made a quick GTK-only patch. Well, threading issues made it less quick
> than I would have liked :P Anyway, the API is this:
Thanks!
> window = al_open_native_log_window(title, flags)
> al_close_native_log_window(window)
> al_append_log(window, text)
> al_extend_log(window, text)
>
> append adds the text as a new line at the end of the log, extend just
> extends the last line but doesn't at a new one. Not sure how to name
> those two or whether there should be two functions. Could just as well
> require use of "\n" at the end if you want a new line. Should probably
> also make it take printf style parameters.
I would just have the printf parameters:
al_append_log(window, const char *format, ...)
I think we should also let the user (try to) close the log window, and
generate an event when that happens. Then examples which output usage
information can give the user a chance to read the message before
calling al_close_native_log_window().
For non-example uses, we should limit the size of the log. Probably a
fixed limit of 1000 lines or so is good enough.
Peter