Closed jinzhongjia closed 1 week ago
Please don't merge this PR yet, I still have some work to do.
Now, everything is ok!
After this work is completed I will try to add linux support
add block and non-block mode, block-time is waiting time for nanoseconds
We cannot keep using PeekMessageA
to retrieve whether there are messages, because this will cause high CPU usage. On this basis, a short sleep will effectively solve the problem.
Another better solution is to use blocking api, which is getMessageA
Hello! Thank you for your work! Please let me know, if you want merge.
I think the PR is ready to be merged
However, the behavior of the init
function is slightly different from that of the init
function in the zig standard library (in the standard library it will return a specific value of a certain type for initialization). I will try to see if I can make it more idiomatic.
However, for the init work, I plan to open another PR later. The current PR has made enough changes.
Looks good to me. But i think we need to change variable name in ConstMenu
. Change enum text
to content
with fields text and separator. And also we should definitely change init function to return instance of Tray. We also need to specify default values for init function. For example nulls on event handlers for click, and default block time.
I will look into it in the weekends. Or I can wait for your PR if you want to do some coding.