macos

Handling “Open Document” (odoc) events in Snow Leopard

China☆狼群 提交于 2021-02-08 07:58:53
问题 I have code in my application that response to "Open Document" (odoc) events. In Mac OS X Tiger and Leopard, this code works fine: - (void) handleOpenDocumentEvent: (NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent { NSAppleEventDescriptor const *const dirObj = [event descriptorForKeyword:keyDirectObject]; DescType const dirObjType = [dirObj descriptorType]; if ( dirObjType == 'alis' ) { // // Open a single file. // NSData const *const data = [dirObj data];

Compound mdfind search

戏子无情 提交于 2021-02-08 07:56:41
问题 The goal is to find all images that are in a certain state or country. mdfind kind:image will find all images mdfind "kMDItemCountry == 'United States'" will find all files what have this property. mdfind kind:image "kMDItemCountry == 'United States'" fails. I've tried using && and various groupings of () but can't make it work. How can I successfully combine 'kind:image' with attribute searches like kMDIxxx? 回答1: I have had a chance to do some experiments as to how mdfind really works, as

Compound mdfind search

[亡魂溺海] 提交于 2021-02-08 07:56:27
问题 The goal is to find all images that are in a certain state or country. mdfind kind:image will find all images mdfind "kMDItemCountry == 'United States'" will find all files what have this property. mdfind kind:image "kMDItemCountry == 'United States'" fails. I've tried using && and various groupings of () but can't make it work. How can I successfully combine 'kind:image' with attribute searches like kMDIxxx? 回答1: I have had a chance to do some experiments as to how mdfind really works, as

Does Xamarin.mac Support GTK# User Interface

谁说我不能喝 提交于 2021-02-08 07:22:06
问题 I have an application coded with Mono.Mac using GTK# for the UI.I now have access to Xamarin.mac.Im trying to migrate the mono.mac solution to xamarin.mac. I'm trying copy-paste the code from mono.mac to a new xamarin.mac project,but there is no GUI builder in the Xamarin.mac project.So does Xamarin.mac support GTK#? Is there a better way i can migrate? EDIT: My goal is to bundle the mono runtime with the app package so that the user need not install it manually. 回答1: MonoMac .csproj

Does Xamarin.mac Support GTK# User Interface

回眸只為那壹抹淺笑 提交于 2021-02-08 07:20:43
问题 I have an application coded with Mono.Mac using GTK# for the UI.I now have access to Xamarin.mac.Im trying to migrate the mono.mac solution to xamarin.mac. I'm trying copy-paste the code from mono.mac to a new xamarin.mac project,but there is no GUI builder in the Xamarin.mac project.So does Xamarin.mac support GTK#? Is there a better way i can migrate? EDIT: My goal is to bundle the mono runtime with the app package so that the user need not install it manually. 回答1: MonoMac .csproj

How do I get the partition offset in OS X with C/C++?

筅森魡賤 提交于 2021-02-08 06:47:59
问题 I want to create my own volume id using the drive serial + partition offset + partition size, but I need to know how to get the partition information on OS X. I have (unsucceedingly) tried the following: int fd; if ((fd = open("/dev/disk0s1", O_RDONLY|O_NONBLOCK)) >= 0) { struct hd_geometry geom; if (ioctl(fd, 0x0301, &geom) == 0){ //0x0301 is HDIO_GETGEO printf("Index = %u\n", geom.start); } close(fd); } But even if that were to succeed, it is a flawed solution since as this noted: hd

How to prevent multiple instances of the same window from opening in macOS?

对着背影说爱祢 提交于 2021-02-08 06:35:37
问题 I am making a Mac Menu Bar app and it has a Preferences option. When the user clicks on it, a Preferences window opens up that shows all the settings for the app. I open the Preferences window like: let storyboard = NSStoryboard(name: "Main", bundle: nil) let windowController = storyboard.instantiateController(withIdentifier: "PreferencesWindowController") as! NSWindowController windowController.showWindow(self) File: AppDelegate.swift (above code is run when user clicks on "Preferences") Now

Trigger a script (AppleScript or JXA) on .app running?

醉酒当歌 提交于 2021-02-08 06:33:13
问题 I have a small computer lab for students to use fairly unsupervised, with a printer attached on the network. I am trying to implement a simple scripting additions alert dialog with all the rules about the printer that I need to pop up when they select print from any number of different applications. I am trying to attach the script directly to the printer itself in the User/Library/Printer directory, (xxx.xxx.xxx.xxx.app) so any browser, or pdf viewer, etc. will get the message displayed when

Creating an add-in for Microsoft Office 2016 for Mac?

帅比萌擦擦* 提交于 2021-02-08 06:27:12
问题 I can see that Office 2016 for Mac now supports add-ins. How do I go about developing one? Will it be possible to convert existing VSTO-developed COM add-ins for Windows to the Mac version? 回答1: No, there is no tool for converting VSTO based add-ins (i.e. COM add-ins) to Office Apps. You need to develop Office Apps (Add-ins) from scratch. FYI MS rebranded Office Apps as Office Add-ins at the Build#15 conference. See Get started with apps for Office in MSDN for more information. 回答2: Yes, you

Packaged tkinter GUI using cx_freeze on MacOS results in a black GUI

女生的网名这么多〃 提交于 2021-02-08 05:57:46
问题 I am building a tkinter GUI for a friend in Python 3.8.3 on a Mac running macOS Catalina 10.15.2 and trying to freeze it using cx_freeze 6.1. When I run the python application in my local environment the application works perfectly. (screenshot: tkinter GUI in local environment) When I package the application using cx_freeze and try to run the Linux executable the tkinter window opens but it is all black and I cannot see anything in it (screenshot: tkinter GUI after packaging with cx_freeze)