Jump to content
Hamidrm

GLISTENER_WITHLISTENER flag in gevent

Recommended Posts

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 by Hamidrm

Share this post


Link to post
Share on other sites

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...