pub fn modal_message<'a, P: Into<ControlHandle>>(
    parent: P,
    params: &MessageParams<'_>
) -> MessageChoice
Expand description

Create a message box for a selected window. The window will be locked until the user close the message box.

This functions panics if a non window control is used as parent (ex: a menu)

Parameters:

  • parent: The reference to a window-like control
  • params: A MessageParams structure that defines how the message box should look
use native_windows_gui as nwg;
fn test_message(parent: &nwg::Window) {
    let p = nwg::MessageParams {
        title: "Hey",
        content: "Cats are cute",
        buttons: nwg::MessageButtons::Ok,
        icons: nwg::MessageIcons::Warning
    };

    assert!(nwg::modal_message(parent, &p) == nwg::MessageChoice::Ok)
}