How to delete window when navigating to other window to free up the memory.

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

    • How to delete window when navigating to other window to free up the memory.

      HI Schoenen,

      i'm working on segger application, where i have 25-30 screen(windows) in my application. as i have more screens, memory conception is also more on Flash and RAM. so i have found the
      WM_DeleteWindow(pMsg->hWin); function to delete window before navigating to other screen. but as i move on and update parameters values on run time, i have used child windows as pop-up and keypad-numeric screens.


      case ID_BUTTON_0: // Notifications sent by 'Button'
      switch(NCode) {
      // USER START (Optionally insert code for reacting on notification message)
      }// USER END
      // USER START (Optionally insert code for reacting on notification message)
      // USER END
      // USER START (Optionally insert additional code for further notification handling)
      // USER END

      after having child windows, on open and close of child windows at 10+ instances i found that my parent screen icons are getting hided.

      now my questions is How to delete window and where to call WM_DeleteWindow(); function with what input. please let me know if any inputs needs to be added from my side.

      Thanks in advance.

      Krishna [img][/img]
    • Hi sven,

      thanks for the reply.

      as i mentioned in above post, in my application, have 20+ screens(with child windows). currently as i said in above post, while navigating from 1st screen to 2nd screen, i'm using WM_DeleteWindow() function to delete 1st screen and creating 2nd scree. as well as while navigating back to 1st screen, using WM_DeleteWindow() function deleting 2nd screen and creating first screen. is this correct way to handle screens or any other method is available? please let me know.

      and i also i want to know as i'm using segger emwin with micrichip harmony configurator, while configuring third party libraries there is an option to assign Memory block size. in example projects it is set to 224KB , as in my application i have set it to 160 due to RAM space. is this causing the hiding of widhgets??

      and for my application we are using Microchip controller(PIC32MZ2025DAG176). i.e. having 256KB of RAM and 2048KB of Flash and 32MB of internal DDR. is this controller is suitable for segger emwin based applications or i need to have any other controllers??

      please let me know your response on above queries.

      Thanks & Regards
      Murali Krishna Meda
    • Hi,

      the approach you have described is good. Although, there is no correct way.

      Setting a memory block size is no longer required. It is sufficient to allocate memory for emWin (GUI_ALLOC_AssignMemory()). It might happen that at one point you do not have enough memory left to create another widget. Of course, this depends on the widget type and what you do with it. A LISTVIEW widget with a lot entries requires quite some memory (storing the strings and some control information).

      Your device should work quite well. Especially with 32MB of RAM.

    • hi Sven,

      thanks for the response.

      As i said internal RAM is 256KB which is being used for normal application and for Frame buffer as well. i could not see any option to configure internal DDR for Framebuffer in Microchip Harmony Configurator. and ihave doubt on internal RAM, because as i see in MPLAB IDE RAM is occupied almost 80%. so i felt that RAM doesn't have enough space to create images on long run.

      as i received response from Microchip, they said that atleast 512KB or 640 KB RAM is required to run these kind of applications(Segger emwin based).

      thanks again for your response and i will check on it.

      Thanks & Regards
      Murali Krishna Meda
    • New

      Hi All,

      Even i'm also facing the same issue of screen hiding when continuous switching happens between multiple screens in stm32 platform .
      case1 : screen hiding issue occuring after 40 screens with the size (#define GUI_NUMBYTES (90 * 1024) ).
      case 2:If i increase the GUI_NUMBYTES to 95*1024 the screen hiding is still occuring but this time after 45 screens.

      As RAM size is constraint in my design i cant increase more than above.
      so is there any procedure to delete the screens to overcome the buffer overflow and screen hiding issue.

      Any help will be really appreciated.
      Thanks in advance !