mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Document run_event_loop() and quit_event_loop()
The C++ versions were there before, but undocumented. The Rust version for quit() was missing.
This commit is contained in:
parent
032a158615
commit
5d58d34e84
3 changed files with 17 additions and 1 deletions
|
@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
- Warnings are now shown in the online code editor.
|
||||
- `sixtyfps::invoke_from_event_loop` was added to the C++ and Rust APIs, to run a function in the UI thread from any thread.
|
||||
- `sixtyfps::run_event_loop()` and `sixtyfps::quit_event_loop()` were added to the Rust and C++ APIs to start and quit the main event loop.
|
||||
- `z` property on items.
|
||||
- The type in two-way bindings can now be omitted.
|
||||
- It's possible to declare aliases for callbacks (`callback clicked <=> other.clicked;`)
|
||||
|
|
|
@ -39,8 +39,8 @@ using cbindgen_private::ItemVTable;
|
|||
using ComponentRef = vtable::VRef<private_api::ComponentVTable>;
|
||||
using ItemRef = vtable::VRef<private_api::ItemVTable>;
|
||||
using ItemVisitorRefMut = vtable::VRefMut<cbindgen_private::ItemVisitorVTable>;
|
||||
using cbindgen_private::ItemWeak;
|
||||
using cbindgen_private::ComponentRc;
|
||||
using cbindgen_private::ItemWeak;
|
||||
using cbindgen_private::TraversalOrder;
|
||||
}
|
||||
|
||||
|
@ -636,11 +636,18 @@ struct VersionCheckHelper
|
|||
};
|
||||
}
|
||||
|
||||
/// Enters the main event loop. This is necessary in order to receive
|
||||
/// events from the windowing system in order to render to the screen
|
||||
/// and react to user input.
|
||||
inline void run_event_loop()
|
||||
{
|
||||
cbindgen_private::sixtyfps_run_event_loop();
|
||||
}
|
||||
|
||||
/// Schedules the main event loop for termination. This function is meant
|
||||
/// to be called from callbacks triggered by the UI. After calling the function,
|
||||
/// it will return immediately and once control is passed back to the event loop,
|
||||
/// the initial call to sixtyfps::run_event_loop() will return.
|
||||
inline void quit_event_loop()
|
||||
{
|
||||
cbindgen_private::sixtyfps_quit_event_loop();
|
||||
|
|
|
@ -263,6 +263,14 @@ pub fn run_event_loop() {
|
|||
.run_event_loop(sixtyfps_corelib::backend::EventLoopQuitBehavior::QuitOnLastWindowClosed);
|
||||
}
|
||||
|
||||
/// Schedules the main event loop for termination. This function is meant
|
||||
/// to be called from callbacks triggered by the UI. After calling the function,
|
||||
/// it will return immediately and once control is passed back to the event loop,
|
||||
/// the initial call to [`run_event_loop()`] will return.
|
||||
pub fn quit_event_loop() {
|
||||
sixtyfps_rendering_backend_default::backend().quit_event_loop();
|
||||
}
|
||||
|
||||
/// Adds the specified function to an internal queue, notifies the event loop to wake up.
|
||||
/// Once woken up, any queued up functors will be invoked.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue