mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Added Foundation bindings
This commit is contained in:
@@ -30,6 +30,7 @@ MenuItem :: struct {using _: Object}
|
||||
MenuItem_alloc :: proc "c" () -> ^MenuItem {
|
||||
return msgSend(^MenuItem, MenuItem, "alloc")
|
||||
}
|
||||
|
||||
@(objc_type=MenuItem, objc_name="registerActionCallback", objc_is_class_method=true)
|
||||
MenuItem_registerActionCallback :: proc "c" (name: cstring, callback: MenuItemCallback) -> SEL {
|
||||
s := string(name)
|
||||
@@ -50,11 +51,21 @@ MenuItem_registerActionCallback :: proc "c" (name: cstring, callback: MenuItemCa
|
||||
return sel
|
||||
}
|
||||
|
||||
@(objc_type=MenuItem, objc_name="separatorItem", objc_is_class_method=true)
|
||||
MenuItem_separatorItem :: proc "c" () -> ^MenuItem {
|
||||
return msgSend(^MenuItem, MenuItem, "separatorItem")
|
||||
}
|
||||
|
||||
@(objc_type=MenuItem, objc_name="init")
|
||||
MenuItem_init :: proc "c" (self: ^MenuItem) -> ^MenuItem {
|
||||
return msgSend(^MenuItem, self, "init")
|
||||
}
|
||||
|
||||
@(objc_type=MenuItem, objc_name="initWithTitle")
|
||||
MenuItem_initWithTitle :: proc "c" (self: ^MenuItem, title: ^String, action: SEL, keyEquivalent: ^String) -> ^MenuItem {
|
||||
return msgSend(^MenuItem, self, "initWithTitle:action:keyEquivalent:", title, action, keyEquivalent)
|
||||
}
|
||||
|
||||
@(objc_type=MenuItem, objc_name="setKeyEquivalentModifierMask")
|
||||
MenuItem_setKeyEquivalentModifierMask :: proc "c" (self: ^MenuItem, modifierMask: KeyEquivalentModifierMask) {
|
||||
msgSend(nil, self, "setKeyEquivalentModifierMask:", modifierMask)
|
||||
@@ -75,6 +86,11 @@ MenuItem_title :: proc "c" (self: ^MenuItem) -> ^String {
|
||||
return msgSend(^String, self, "title")
|
||||
}
|
||||
|
||||
@(objc_type=MenuItem, objc_name="setTitle")
|
||||
MenuItem_setTitle :: proc "c" (self: ^MenuItem, title: ^String) -> ^String {
|
||||
return msgSend(^String, self, "title:", title)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@(objc_class="NSMenu")
|
||||
|
||||
Reference in New Issue
Block a user