Hamidrm Posted November 26, 2018 Report Share 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 Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 7, 2018 Report Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now