MESSAGE does not disapper after clicking OK

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hi,

    If the default background is behind the message box, it is most likely that it disappeared but the background doesn't 'know' how to redraw and the old drawing (the message box) is still present.

    Please try this code:

    C Source Code

    1. #include "DIALOG.h"
    2. /*********************************************************************
    3. *
    4. * _cbBk
    5. */
    6. static void _cbBk(WM_MESSAGE * pMsg) {
    7. switch (pMsg->MsgId) {
    8. case WM_PAINT:
    9. GUI_SetBkColor(GUI_BLACK);
    10. GUI_Clear();
    11. break;
    12. default:
    13. WM_DefaultProc(pMsg);
    14. break;
    15. }
    16. }
    17. /*********************************************************************
    18. *
    19. * MainTask
    20. */
    21. void MainTask(void) {
    22. GUI_Init();
    23. WM_SetCallback(WM_HBKWIN, _cbBk);
    24. GUI_MessageBox("A message", "Caption", 0);
    25. while (1) {
    26. GUI_Delay(100);
    27. }
    28. }
    Display All


    Regards
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.