Replies: 1 comment
-
This isn't an issue. Moved to discussions. A more idiomatic version would be: using ObjectiveC, .Foundation
@objcwrapper NSApplication <: NSObject
shared_application() =
NSApplication(@objc [NSApplication sharedApplication]::id{NSApplication})
@enum NSApplicationActivationPolicy::NSInteger begin
NSApplicationActivationPolicyRegular = 0
NSApplicationActivationPolicyAccessory = 1
NSApplicationActivationPolicyProhibited = 2
end
function show_gl_icon_in_dock(show::Bool)
load_framework("AppKit")
app = shared_application()
val = show ? NSApplicationActivationPolicyRegular : NSApplicationActivationPolicyAccessory
@objc [app::id{Object} setActivationPolicy:val::NSApplicationActivationPolicy]::id{Object}
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I took a code snippet calling AppKit from an old version of ObjectiveC.jl and adapted it to the current one. Specifically, I needed
[NSApp setActivationPolicy]
.Not sure if it looks reasonable already or should be written better? I'm not really familiar with ObjectiveC itself...
Here's the code in question, seems very verbose:
(at https://github.com/JuliaAPlavin/MakieExtra.jl/blob/000000006524e0a0729128be0a0681f081cff0aa/src/MakieExtra.jl#L69-L85)
Beta Was this translation helpful? Give feedback.
All reactions