-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature suggestion: {.noredraw.} pragma #277
Conversation
karax/karaxdsl.nim
Outdated
break | ||
if hasNoRedrawPragma: | ||
result = newCall(ident"addEventHandlerNoRedraw", tmpContext, | ||
newDotExpr(bindSym"EventKind", n[0]), anon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the debugEcho
calls and move the logic to a helper proc.
I've definitely used I do like this PR though, it seems less error prone than the global flag. Good work @choltreppe |
This reverts commit 0d4ce4b.
* add {.noredraw.} pragma for event handlers * put .noredraw. pragma handling in seperate proc * refactor * refactor * Revert "refactor" This reverts commit 0d4ce4b. * use result for return
* add {.noredraw.} pragma for event handlers * put .noredraw. pragma handling in seperate proc * refactor * refactor * Revert "refactor" This reverts commit 0d4ce4b. * use result for return
There is currently no easy way to surpress redraw just for one specific handler (probably because it isnt needed very often).
You can
kxi.surpressRedraw = true
inside your handler, but then there is no way to set it back afterwards.The only way currently is using
addEventListener
manually, which isnt very elegant.So I added
addEventHandlerNoRedraw
procs tokarax.nim
and the.noredraw.
pragma to the dsl syntax.Now you just need to do:
or
maybe this would be nice to have in the repo