Skip to content

Commit

Permalink
test run
Browse files Browse the repository at this point in the history
  • Loading branch information
oligamiq committed Dec 18, 2023
1 parent ceb51b6 commit 1826f4c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions rust/macos/objc/nick_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ impl Debug for NickName {
}
}

#[link(name = "AppKit", kind = "framework")]
extern "system" {
static NSImageNameComputer: *const std::ffi::c_char;
}
// #[link(name = "AppKit", kind = "framework")]
// extern "system" {
// static NSImageNameComputer: *const std::ffi::c_char;
// }

impl NickName {
pub fn new() -> crate::Result<Self> {
preview_all_classes();

let name = unsafe { CStr::from_ptr(NSImageNameComputer.into()) };
// let name = unsafe { CStr::from_ptr(NSImageNameComputer.into()) };

println!("global name: {}", name.to_str().unwrap());
// println!("global name: {}", name.to_str().unwrap());

Ok(Self(Arc::new(RwLock::new(unsafe {
// Create an instance of the UIDevice class
Expand Down Expand Up @@ -139,9 +139,7 @@ impl NickName {
self.set_hostname(nickname)?;

let name = self.get_name()?;
println!("name: {}", name);


println!("set name: {}", name);

Ok(())
}
Expand Down

0 comments on commit 1826f4c

Please sign in to comment.