wxrust_base/generated/
methods_m.rs

1use super::*;
2
3// wxMessageOutput
4/// This trait represents [C++ `wxMessageOutput` class](https://docs.wxwidgets.org/3.2/classwx_message_output.html)'s methods and inheritance.
5///
6/// See [`MessageOutputIsOwned`] documentation for the class usage.
7pub trait MessageOutputMethods: WxRustMethods {
8    /// Return the global message output object.
9    ///
10    /// See [C++ `wxMessageOutput::Get()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_output.html#aad01aa8c43d59976cd19d8b81311b089).
11    fn get() -> Option<MessageOutputIsOwned<false>> {
12        unsafe { MessageOutput::option_from(ffi::wxMessageOutput_Get()) }
13    }
14    /// Sets the global message output object.
15    ///
16    /// See [C++ `wxMessageOutput::Set()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_output.html#a14dc1b2024d1b440e1fb574167f80442).
17    fn set<M: MessageOutputMethods>(msgout: Option<&M>) -> Option<MessageOutputIsOwned<false>> {
18        unsafe {
19            let msgout = match msgout {
20                Some(r) => r.as_ptr(),
21                None => ptr::null_mut(),
22            };
23            MessageOutput::option_from(ffi::wxMessageOutput_Set(msgout))
24        }
25    }
26    // NOT_SUPPORTED: fn Printf()
27    /// Method called by Printf() to really output the text.
28    ///
29    /// See [C++ `wxMessageOutput::Output()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_output.html#ae8b0b6734006e716bd80fd053a7b4e4d).
30    fn output(&self, str: &str) {
31        unsafe {
32            let str = WxString::from(str);
33            let str = str.as_ptr();
34            ffi::wxMessageOutput_Output(self.as_ptr(), str)
35        }
36    }
37}