diff options
author | Ian Roxborough <irox@redhat.com> | 2001-09-10 00:22:29 +0000 |
---|---|---|
committer | Ian Roxborough <irox@redhat.com> | 2001-09-10 00:22:29 +0000 |
commit | ee7709783c85577eba6af30cd711e17e403befed (patch) | |
tree | 74233a880ee1f7e13c7ded61d093318e8c6e7d5c /tk/win/tkWinInit.c | |
parent | a850c17c374d03259483e799b09326d255e17487 (diff) | |
download | gdb-ee7709783c85577eba6af30cd711e17e403befed.tar.gz |
Tk 8.3 upgradeTK_8_3
Diffstat (limited to 'tk/win/tkWinInit.c')
-rw-r--r-- | tk/win/tkWinInit.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tk/win/tkWinInit.c b/tk/win/tkWinInit.c index 4ddfd56cb4e..29f2246c977 100644 --- a/tk/win/tkWinInit.c +++ b/tk/win/tkWinInit.c @@ -43,6 +43,12 @@ int TkpInit(interp) Tcl_Interp *interp; { + /* + * This is necessary for static initialization, and is ok + * otherwise because TkWinXInit flips a static bit to do + * its work just once. + */ + TkWinXInit(GetModuleHandle(NULL)); return Tcl_Eval(interp, initScript); } @@ -116,6 +122,19 @@ TkpDisplayWarning(msg, title) char *msg; /* Message to be displayed. */ char *title; /* Title of warning. */ { - MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL - | MB_SETFOREGROUND | MB_TOPMOST); + int l; + + if ( GetStdHandle(STD_ERROR_HANDLE) != INVALID_HANDLE_VALUE && + GetFileType(GetStdHandle(STD_ERROR_HANDLE)) != FILE_TYPE_UNKNOWN ) { + WriteFile(GetStdHandle(STD_ERROR_HANDLE), title, strlen(title), &l, NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), ": " , 2 , &l, NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg , strlen(msg) , &l, NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), "\n" , 1 , &l, NULL); + FlushFileBuffers(GetStdHandle(STD_ERROR_HANDLE)); + } else { + MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL + | MB_SETFOREGROUND | MB_TOPMOST); + } } + + |