monomac

Beep with custom frequency and duration

杀马特。学长 韩版系。学妹 提交于 2019-12-10 20:51:31
问题 I want to play Beep sound in my Mac Os X and specify duration and frequency. On Windows it can be done by using Beep function (Console.Beep in .Net). Is there anything equivalent in Mac? I am aware of NSBeep but it does not take any parameters. 回答1: On the Mac, the system alert sound is a sampled (prerecorded) sound that the user chooses. It often sounds nothing like a beep—it may be a honk, thunk, blare, or other sound that can't be as a simple constant waveform of fixed shape, frequency,

NSImage from byte array

眉间皱痕 提交于 2019-12-10 17:48:14
问题 I'm trying to display an image in a NSImageView, with an image contained in a Byte array. How can I do this? From what I understand I need to convert my byte[] to an NSData variable and feed that to an NSImage. Is this correct? How do I do it? I've tried casting and that doesn't work, and there doesn't seem to be any conversion built in... I have tried the following: Casting: NSData bytesAsMacVariable = (NSData) imageAsBytes; Also tried NSData bytesAsMacVariable = imageAsBytes as NSData;

Submitting sandboxed MonoMac app without accessing shared memory?

亡梦爱人 提交于 2019-12-10 17:14:05
问题 I have a Sandboxed MonoMac based application in the MacAppStore, with the latest update to the app pushed to MAS I received a message from Apple that the application accesses /dev/shm, and that this update will be allowed but future updates must not access /dev/shm. I'm not using any shared memory in my application so I'm assuming this is because parts of MonoMac is using Shared memory (which would make sense). How can I possibly work around this in the future? 回答1: The shared memory access

Custom Control equivalent in XCode/MonoMac

我只是一个虾纸丫 提交于 2019-12-08 01:01:26
问题 I'm a .NET developer trying his hand at an OSX port of a Windows application. I'm using MonoDevelop and MonoMac (with the XCode Interface Builder) to create my UI. Coming from Windows, I'm trying to understand the Cocoa equivalent of a "UserControl" since I used these extensively in my WinForm version. I have a group of controls (let's say a label, textbox and button) that I want to package up and reuse in various places throughout my Cocoa UI. From what I understand, I need to create a

In Mono on OSX how do I get access to the current proxy?

我的梦境 提交于 2019-12-07 18:16:58
问题 Both GetSystemWebProxy and DefaultWebProxy return null. WebRequest.GetSystemWebProxy(); WebRequest.DefaultWebProxy; 回答1: If you use a recent version of monomac (or build it from source) then you should be able to call the static method CFNetwork.GetDefaultProxy (source, look at the end of the file) to get an IWebProxy instance that should match what OSX is using. 来源: https://stackoverflow.com/questions/8004011/in-mono-on-osx-how-do-i-get-access-to-the-current-proxy

Creating a simple NSOutlineView datasource with MonoMac

被刻印的时光 ゝ 提交于 2019-12-07 02:55:19
问题 I cant seem to figure out how to create a simple NSOutlineView with 2 columns, and a datastructure that is more than 1 level deep (a hierachy). I've been researching this for days, and all I can find is Objective C examples, which I really can't use for anything. I understand there are different patterns for doing this, one being the DataSource pattern. I tried creating a class that inherited from NSOutlineViewDataSource, however thats all I got, I have no clue on what I should do next! Lets

Mac app store helper tool Sandboxing

空扰寡人 提交于 2019-12-06 10:26:40
问题 My app consist of two executables the main app executable small console app to process some files, this executable is on Resources folder (no root privileges required) The thing is that I don't know how to submit this app to appstore, I get the following response from apple Invalid Signature - the main app bundle appname at path appname.app is signed but the signature is invalid. The following error(s) were reported from codesign: a sealed resource is missing or invalid In architecture: i386

Custom Control equivalent in XCode/MonoMac

旧时模样 提交于 2019-12-06 10:26:00
I'm a .NET developer trying his hand at an OSX port of a Windows application. I'm using MonoDevelop and MonoMac (with the XCode Interface Builder) to create my UI. Coming from Windows, I'm trying to understand the Cocoa equivalent of a "UserControl" since I used these extensively in my WinForm version. I have a group of controls (let's say a label, textbox and button) that I want to package up and reuse in various places throughout my Cocoa UI. From what I understand, I need to create a "custom view" by subclassing NSView (let's call it "MyView"). I can create "MyView" in the Interface Builder

MonoGame Samples not compiling on Mountain Lion

女生的网名这么多〃 提交于 2019-12-06 09:16:40
So I installed MonoFramework, MonoDevelop and MonoMac and downloaded the latest version of MonoGame. I tried compiling the samples but they all fail with the same error Parsing error of #error Unknown platform . The problem seems to be that for some reason #if MONOMAC and #elif MONOMAC are being ignored. If I remove the Windows, XBOX and Linux related code and get rid of the #if MONOMAC the code compiles and executes. Has there been a change and should I use something else instead of MONOMAC in my platform check (i tried with __APPLE__ and MAC but neither worked). Thank you in advance.

Embed dylib in Xamarin.Mac binding dll

做~自己de王妃 提交于 2019-12-05 22:11:51
问题 I'm creating bindings for Xamarin.Mac / MonoMac . I'd like to embed the dylib in the generated dll like it's done on Xamarin.iOS with the [LinkWith] attribute. Is it possible to do that ? if so how ? Or should I load the dylib from the consuming application ? again in this case, how ? I tried: - dropping the dylib in the Native References folder (doesn't work) - adding a [assembly: MonoMac.RequiredFramework] attribute (doesn't find the dylib ) 回答1: I managed to load the .dylib from the