-
-
Save abock/757f21a6a9ffd3f1e075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSComboBoxExtensions.cs | |
// | |
// Author: | |
// Aaron Bockover <abock@xamarin.com> | |
// | |
// Copyright 2015 Xamarin Inc. All rights reserved. | |
using System; | |
using System.Runtime.InteropServices; | |
using ObjCRuntime; | |
using Foundation; | |
namespace AppKit | |
{ | |
public static class NSComboBoxExtensions | |
{ | |
[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")] | |
static extern IntPtr IntPtr_objc_msgSend_nint (IntPtr receiver, IntPtr selector, nint arg1); | |
static readonly IntPtr selItemObjectValueAtIndex = Selector.GetHandle ("itemObjectValueAtIndex:"); | |
public static NSObject FixedGetItem (this NSComboBox comboBox, nint index) | |
{ | |
return Runtime.GetNSObject<NSObject> (IntPtr_objc_msgSend_nint ( | |
comboBox.Handle, selItemObjectValueAtIndex, index)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment