Skip to content

Commit

Permalink
Merge pull request #8 from lawrencecchen/main
Browse files Browse the repository at this point in the history
feat: Add panel.make_key_and_order_front & panel.set_content_size
  • Loading branch information
ahkohd authored May 27, 2023
2 parents 7782d8b + 784781c commit cd1c0f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/raw_nspanel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ impl RawNSPanel {
let _: () = unsafe { msg_send![self, makeKeyWindow] };
}

pub fn make_key_and_order_front(&self, sender: Option<id>) {
let _: () = unsafe { msg_send![self, makeKeyAndOrderFront: sender.unwrap_or(nil)] };
}

pub fn order_front_regardless(&self) {
let _: () = unsafe { msg_send![self, orderFrontRegardless] };
}
Expand All @@ -134,6 +138,10 @@ impl RawNSPanel {
let _: () = unsafe { msg_send![self, setLevel: level] };
}

pub fn set_content_size(&self, width: f64, height: f64) {
let _: () = unsafe { msg_send![self, setContentSize: (width, height)] };
}

pub fn set_style_mask(&self, style_mask: i32) {
let _: () = unsafe { msg_send![self, setStyleMask: style_mask] };
}
Expand Down

0 comments on commit cd1c0f9

Please sign in to comment.