Hamidrm Report post Posted November 26, 2018 (edited) I have two frames widget in my project and created a customize widget for Horizontal Menu. I need to destroy previous frame at switching between them and create the new second frame in each toggle event. when I call gwinDestroy for first frame, I will miss events of "Horizontal Menu" in second frame. I traced uGFX functions and realize that by calling gwinDestroy, uGFX will call doExitEvent from the deleteAssignments and set "flags" field of widget GListener to GLISTENER_WITHLISTENER. Then when new Frame created and toggle button attached to its child (Horizontal Menu), my program will miss widget events because of GLISTENER_WITHLISTENER flag. For ensuring about it, I commented line 34 of https://git.ugfx.io/uGFX/uGFX/src/master/src/gevent/gevent.c temporary and then second frame toggle event works well as first one. My question is how can i reset GListener->flags of widgets to zero (or flags&=~GLISTENER_WITHLISTENER), after calling gwinDestroy? Edited November 26, 2018 by Hamidrm Share this post Link to post Share on other sites
Joel Bodenmann Report post Posted December 7, 2018 I'll have to look at this when I got a bit more time to understand this properly. However, unless you're in a serious memory shortage I'd recommend you not to destroy & re-create the widgets. Instead, just use gwinShow() and gwinHide() (alternatively gwinSetVisible()) to make the appropriate widget become visible. Share this post Link to post Share on other sites