Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ImTheSquid committed Sep 16, 2024
1 parent e1c3331 commit df57099
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/appkit/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ impl App {
});
}

/// Sends an update() message to each onscreen window.
pub fn update_windows() {
shared_application(|app| unsafe {
let _: () = msg_send![app, updateWindows];
Expand Down
8 changes: 7 additions & 1 deletion src/appkit/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,16 @@ impl<T> Window<T> {
}
}

pub fn set_scale(&self, rect: Rect) {
/// Sets the origin and size of the window’s frame rectangle according to a given frame rectangle,
/// thereby setting its position and size onscreen.
pub fn set_frame(&self, rect: Rect) {
let rect: CGRect = rect.into();
unsafe {
let _: () = msg_send![&*self.objc, setFrame:rect display:YES];
}
}

/// Sets whether the window is transparent to mouse events.
pub fn set_ignores_mouse_events(&self, ignore: bool) {
unsafe {
let _: () = msg_send![&*self.objc, setIgnoresMouseEvents:match ignore {
Expand All @@ -355,6 +358,7 @@ impl<T> Window<T> {
}
}

/// Sets whether the window accepts mouse-moved events.
pub fn set_accepts_mouse_moved_events(&self, accept: bool) {
unsafe {
let _: () = msg_send![&*self.objc, setAcceptsMouseMovedEvents:match accept {
Expand All @@ -364,6 +368,7 @@ impl<T> Window<T> {
}
}

/// Sets the window’s visible state to the value you specify.
pub fn set_is_visible(&self, visible: bool) {
unsafe {
let _: () = msg_send![&*self.objc, setIsVisible:match visible {
Expand All @@ -373,6 +378,7 @@ impl<T> Window<T> {
}
}

/// Sets whether the window has a shadow.
pub fn set_has_shadow(&self, shadow: bool) {
unsafe {
let _: () = msg_send![&*self.objc, setHasShadow:match shadow {
Expand Down

0 comments on commit df57099

Please sign in to comment.