move variable to window with memdev and without redraw other widget

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

  • move variable to window with memdev and without redraw other widget

    Hi!


    I have a variable
    Which was changed every second value such as temperature
    The amount I want to transfer my windows without drawing other widget and without flicker
    please guide me

    thanks

    H.T
  • Hello,

    Attached is a sample which shows how to pass a memory device as user data to a window. The window simply draws the memory device while the memory device itself gets drawn in the super loop. Also only the window gets redrawn. Be aware that, depending on the create flags set when creating a window, it might be possible that the background gets redrawn, too. This is the case if the create flag WM_CF_HASTRANS is set. In a lot of scenarios this flag is not required.

    Another way of drawing the value inside window is to pass the value itself as user data and draw the value inside the window.

    The best way of avoiding are multiple buffers but might be not available on every hardware. If it is available simply call WM_MULTIBUF_Enable(1). Of course it needs to be configured in the LCDConf.c before you can make use of it.

    Another way of avoiding flickering is to enable automatic use of memory devices by calling WM_SetCreateFlags(WM_CF_MEMDEV). IF this flag is set any drawing operation in a window/widgets will be done into a memory device and once this drawing is finished the ready drawn memory device will be displayed. But you might still see how single window are getting displayed (depending on how fast the hardware is).

    Regards,
    Sven
    Files