Skip to content
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

Custom event question #813

Open
TsVan1 opened this issue Jan 25, 2024 · 2 comments
Open

Custom event question #813

TsVan1 opened this issue Jan 25, 2024 · 2 comments

Comments

@TsVan1
Copy link

TsVan1 commented Jan 25, 2024

Are events fixed in ftxui, how to add a custom event, and a callback function for custom events?

@ArthurSonzogni
Copy link
Owner

ArthurSonzogni commented Jan 25, 2024

You can create custom event like this:

ScreenInteractive::Active()->Post(Event::Special("My custom event"));

It will be stored in a FIFO queue, and dispatched to the component.

If you want to post a task, you can use:

ScreenInteractive::Active()->Post(callback)

Similarly, it will be stored in the same FIFO queue, and executed at some point.

@TsVan1
Copy link
Author

TsVan1 commented Jan 26, 2024

Thank you for your answer, my problem has been solved perfectly, and it is suggested that the complete mt/mtd/md/mdd version of lib file should be added to the release package of windows version. during the test, I found that the lib file provided only supports mdd. If you want to use another version, you need to compile it yourself. of course, if someone who is familiar with it can quickly find the problem and compile it himself, it may take a long time for someone like me to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants