diff --git a/common/programmererrors.h b/common/programmererrors.h index a529878a..d299631a 100644 --- a/common/programmererrors.h +++ b/common/programmererrors.h @@ -7,7 +7,7 @@ func) #define uiprivProgrammerErrorWrongThread(func) \ - uiprivProgrammerError("attempt to call %s() on a thread other than the GUI thread", \ + uiprivProgrammerError("attempt to call %s() on a thread other than the UI thread", \ func) #define uiprivProgrammerErrorWrongStructSize(badSize, structName, func) \ diff --git a/doc/init-main.md b/doc/init-main.md index 4e6ff042..bc764f62 100644 --- a/doc/init-main.md +++ b/doc/init-main.md @@ -6,7 +6,7 @@ In order to use libui, you must first initialize it. All initialization is done through the `uiInit()` function. This is usually one of the first things you do in your program. -The thread you call `uiInit()` on becomes the "GUI thread". This is the thread that all your UI is done on from the perspective of the operating system, so it is absolutely essential that you do **not** call any other function of libui from any other thread that you create (except for `uiQueueMain()`, which is discussed later). +The thread you call `uiInit()` on becomes the "UI thread". This is the thread that all your UI is done on from the perspective of the operating system, so it is absolutely essential that you do **not** call any other function of libui from any other thread that you create (except for `uiQueueMain()`, which is discussed later). Furthermore, on some systems, this thread must also be the thread that `main()` is called on; macOS is the notable example here. Therefore, to be safe, you should only call `uiInit()` from `main()`, or from a function that runs on the same thread as `main()`. If you are using a language binding, that binding may provide further instruction on how to do so in that language. @@ -87,7 +87,7 @@ bool uiInit(void *options, uiInitError *err); `options` must be `NULL`; no options are currently defined. If `options` is not `NULL`, `uiInit()` will return an error without initializing anything. -As part of initialization, the thread that `uiInit()` is called on becomes the GUI thread. All of the functions of libui except `uiQueueMain()` **must** be called from this thread. On platforms where which thread you run GUI code on is restricted, `uiMain()` will return an error if it is called from the wrong thread; to avoid this, you should always call `uiInit()` from the thread that `main()` itself is called from. +As part of initialization, the thread that `uiInit()` is called on becomes the UI thread. All of the functions of libui except `uiQueueMain()` **must** be called from this thread. On platforms where which thread you run GUI code on is restricted, `uiMain()` will return an error if it is called from the wrong thread; to avoid this, you should always call `uiInit()` from the thread that `main()` itself is called from. If `uiInit()` fails, no other libui function is safe to call. This means that you cannot use any of libui's message box functions to report the error. diff --git a/test/noinitwrongthread.c b/test/noinitwrongthread.c index 44640b23..30e2f5bf 100644 --- a/test/noinitwrongthread.c +++ b/test/noinitwrongthread.c @@ -23,7 +23,7 @@ TestNoInit(FunctionsFailBeforeInit) } static const struct checkErrorCase wrongThreadCases[] = { -#define allcallsCase(f, ...) { #f "()", allcallsCaseFuncName(f), "attempt to call " #f "() on a thread other than the GUI thread" }, +#define allcallsCase(f, ...) { #f "()", allcallsCaseFuncName(f), "attempt to call " #f "() on a thread other than the UI thread" }, #include "allcalls.h" #undef allcallsCase { NULL, NULL, NULL },