How do I use functions named GUI_Disp... and GUI_Draw... for drawing on a widget?

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

    • Hi,

      The easiest way would indeed be to place a TEXT widget on top of the IMAGE widget.

      The other way would be to call the GUI_Disp... routine within a callback when reacting on a WM_PAINT message. So you would manually handle the drawing of the widget.

      In your case you would set a custom callback to the IMAGE widget and call your drawing function after calling the default IMAGE callback to ensure that the image is still drawn normally.

      C Source Code

      1. case WM_PAINT:
      2. //
      3. // Call standard IMAGE callback so that the image is still displayed.
      4. //
      5. IMAGE_Callback(pMsg);
      6. //
      7. // Display something on top...
      8. //
      9. GUI_Disp...
      10. break;

      In our wiki you can find a simple example on how to set a custom callback to a widget.

      Best regards,
      Florian
      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.