Revert "Set up basic logging."
Not right now.
This reverts commit 499bf2d00c
.
This commit is contained in:
parent
499bf2d00c
commit
bf0b38b6c2
1
TODO.md
1
TODO.md
|
@ -1,4 +1,3 @@
|
|||
- refine logging
|
||||
- figure out how to deal with dchild at all, including preferred sizes
|
||||
- make OS X uiEntry width based on default in Interface Builder, not from sizeToFit
|
||||
- update state whenever setting parent
|
||||
|
|
|
@ -15,14 +15,14 @@ void die(const char *fmt, ...)
|
|||
|
||||
int onClosing(uiWindow *w, void *data)
|
||||
{
|
||||
uiLog("[test program] in onClosing()\n");
|
||||
printf("in onClosing()\n");
|
||||
uiQuit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int onShouldQuit(void *data)
|
||||
{
|
||||
uiLog("[test program] in onShouldQuit()\n");
|
||||
printf("in onShouldQuit()\n");
|
||||
if (uiMenuItemChecked(shouldQuitItem)) {
|
||||
uiControlDestroy(uiControl(data));
|
||||
return 1;
|
||||
|
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
w = newWindow("Main Window", 320, 240, 1);
|
||||
uiWindowOnClosing(w, onClosing, NULL);
|
||||
uiLog("[test program] main window %p\n", w);
|
||||
printf("main window %p\n", w);
|
||||
|
||||
uiOnShouldQuit(onShouldQuit, w);
|
||||
|
||||
|
@ -103,8 +103,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
uiControlShow(uiControl(w));
|
||||
uiMain();
|
||||
uiLog("[test program] after uiMain()\n");
|
||||
printf("after uiMain()\n");
|
||||
uiUninit();
|
||||
uiLog("[test program] after uiUninit()\n");
|
||||
printf("after uiUninit()\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ TEXT(Group, uiGroup, uiGroupTitle, uiGroupSetTitle)
|
|||
|
||||
static void onChanged(uiEntry *e, void *data)
|
||||
{
|
||||
uiLog("[test program] onChanged()\n");
|
||||
printf("onChanged()\n");
|
||||
}
|
||||
|
||||
static void toggleSpaced(uiCheckbox *c, void *data)
|
||||
|
|
|
@ -9,7 +9,7 @@ static uiProgressBar *pbar;
|
|||
static void on ## what ## Changed(ui ## what *this, void *data) \
|
||||
{ \
|
||||
uintmax_t value; \
|
||||
uiLog("[test program] on %s changed\n", #what); \
|
||||
printf("on %s changed\n", #what); \
|
||||
value = ui ## what ## Value(this); \
|
||||
uiSpinboxSetValue(spinbox, value); \
|
||||
uiSliderSetValue(slider, value); \
|
||||
|
|
|
@ -28,9 +28,6 @@ func OnShouldQuit(f *func(data *void) int, data *void);
|
|||
|
||||
func FreeText(text *char);
|
||||
|
||||
// TODO add ... to IDL
|
||||
raw "_UI_EXTERN void uiLog(const char *format, ...);";
|
||||
|
||||
func RegisterType(name *const char, parent uintmax_t, size size_t) uintmax_t;
|
||||
func IsA(p *void, type uintmax_t, fail int) *void;
|
||||
struct Typed {
|
||||
|
|
|
@ -34,21 +34,6 @@ int windowClassOf(HWND hwnd, ...)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// TODO refine this
|
||||
void uiLog(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[2048];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(buf, 2044, fmt, ap);
|
||||
va_end(ap);
|
||||
// unfortunately we need to make sure this is callable even before uiInit() executes or after uiUninit() has executed
|
||||
// that means we can't use toUTF16(), because that requires our private heap
|
||||
// sadly that means we're stuck with OutputDebugStringA() without some serious refinement
|
||||
OutputDebugStringA(buf);
|
||||
}
|
||||
|
||||
void complain(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
Loading…
Reference in New Issue