Add Window::title getter on Windows and macOS

This commit is contained in:
Amr Bashir 2022-11-03 10:11:37 -07:00 committed by GitHub
parent a7a7cc64cd
commit 08f9e374e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 64 additions and 7 deletions

View file

@ -143,6 +143,10 @@ extern_methods!(
#[sel(setTitle:)]
pub fn setTitle(&self, title: &NSString);
pub fn title_(&self) -> Id<NSString, Shared> {
unsafe { msg_send_id![self, title] }
}
#[sel(setReleasedWhenClosed:)]
pub fn setReleasedWhenClosed(&self, val: bool);

View file

@ -1115,6 +1115,11 @@ impl WinitWindow {
let state = self.shared_state.lock().unwrap();
state.current_theme
}
#[inline]
pub fn title(&self) -> String {
self.title_().to_string()
}
}
impl WindowExtMacOS for WinitWindow {