osx

Forcing a Cocoa app called from java to take focus

I have an OSX cocoa app that is called from my java like so: String cmd = "/Users/mike/ASJPictureTaker.app/Contents/MacOS/ASJPictureTaker"; Runtime run = Runtime.getRuntime(); Process pr; pr = run.exec(cmd); pr.waitFor(); The ASJPictureTaker app loads and works fine but when the exec is called it does not take focu...

Write Mac OS X apps with Visual Studio

Hey guys, I just came upon this article here which can turn your day to day visual basic app to run on mac os x. Here is the link: http://mac.sillydog.org/dev/visual%5Fstudio.php The thing I don't get is that the author doesn't tell us specifically what to download, and where to get all the files. He's a bit vague... Can anyone make thi...

Getting a CGIImageRef from an NSImage in Cocoa on Mac OS X

I need to get a CGIImageRef from an NSImage. Is there an easy way to do this in Cocoa for Mac OS X? ...

NSComboBox - Obtaining selected information and NSComboBoxDataSource

For the life of me, I am being continually stumped with NSComboBox. I created an object that conforms the NSComboBoxDataSource protocol, and implemented: - (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox; - (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index; I set the instance of my NSComboBox...

Mac OS X app/service and stdin?

I'm debugging a service I'm developing, which basically will open my .app and pass it some data to stdin. But it doesn't seem like it's possible to something like: open -a myapp.app < foo_in.txt Is it possible to pass stuff to an .app's stdin at all? Edit: Sorry, I should have posted this on SO and been more clear. What I'm trying to...

Howto draw a rect on screen. NSOpenGLContext vs transparent NSWindow + custom NSView

I'm reading pixels from an area of the main screen via NSOpenGLContext. Now I would like to draw a rect around that area to indicate where it actually is. How would I do this? My first thought was the "Cocoa way": create a transparent fullscreen NSWindow and a custom NSView to draw the rectangle path. But that feels a bit too complicated...

How to discover number of cores on Mac OS X?

Google is failing me, so I decided to ask here... How can you tell, from the command line, how many cores are on the machine when you're running Mac OS X? On Linux, I use: x=$(awk '/^processor/ {++n} END {print n+1}' /proc/cpuinfo) It's not perfect, but it's close. This is intended to get fed to make, which is why it gives a result...

What does the console error 'Unable to clear quarantine' mean?

I'm making an OS X Installer package. I download it from a build machine onto a test machine (10.5.8) and then run it. In the console, the following message is immediately logged: kernel[0]: Finder[52646] Unable to clear quarantine '<package name>': 30 From what I've read, Leopard sets a quarantine extended attribute on all downloade...

USB / Bluetooth API for iPhone?

Hi Is there a Mac OS X Bluetooth or USB API that's easy to work with (specifically if you want to be able to access a connected iPhone and send/receive information)? Thanks. ...

Obtaining a proc pointer to a Carbon API at runtime

I have a Mac application that I must build against the Mac OS 10.4 SDK for various reasons beyond my control. Given that my application's minimum OS version will be 10.5. (I know, I know... but I can't give any more details than the above to justify why this is the case.) Within the Mac OS 10.5 SDK is an API, FSMatchAliasBulk, for which...

How to make a dashboard widget in mac os x using python [closed]

Found that is possible to make cocoa apps with python: http://developer.apple.com/cocoa/pyobjc.html My question now if it's possible to make dashboard widgets with python: http://developer.apple.com/macosx/dashboard.html ...

Finding the correct Python framework with cmake

I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using the following commands in CMakeLists.txt include(FindPythonInterp) include(FindPythonLibs ) However, while cmake identified the correct ...

What are your most useful Xcode templates?

Xcode comes with a few templates (file templates, project template, etc.). If you don't know what I'm talking about, take a look. After searching on Google for some time I couldn't find any other useful templates. So here it is: What are your most useful Xcode templates? I'll start with a pretty boring Objcetive-C category file temple....

Is there a way to use the OSX cocoa NSApplication method activateIgnoringOtherApps: to activate an app that is already loading

This may be a dumb question but it seems like activateIgnoringOtherApps: may be the only way to activate an app using Cocoa. I have a java app that loads up a Cocoa app and I want the Cocoa app to be activated when this happens. The problem is I do not want to have to launch an intermediate app (some sort of controller) and use this ap...

applicationShouldTerminateAfterLastWindowClosed: does not seem to work when the red x is used to close my Cocoa app

I have a small OSX Cocoa app that just bring up an IKPicutreTaker and saves the picture to a file if one is set. I use applicationShouldTerminateAfterLastWindowClosed: to close the application when the pictureTaker is closed. This all works fine when I either set(this is done when you have picked the picture you want) or when you hit c...

Open complex file:// uri in new Firefox tab on OS X

I need a way to open a new URL in firefox from the shell on OS X. The normal way I do this is with the open command ... but the open command doesn't seem to pass query/fragment values when the location is a file: uri. Granted, this a bit of an abuse of a file uri, but if you give either FF or Safari the URI in the loc bar, they (seem to)...

Cocoa Pop-up Window Similar to iCal

I want to open an overlay window (pop up window) when a user selects a cell in my NSTableView similar to selecting an event in iCal. Selecting the event in iCal shows a Window to edit the event, but does so by smoothly animating the window open and adding an arrow pointing to the even in the underlying calendar. Does anyone know what is ...

What does this Python code do: shell=(sys.platform!="win32"))

I don't understand what this code is doing, I'm wanting to run a command line, in Mac OS X, the code I'm using is from somebody running a Windows command line. The command still executes, but I'd like to know what the sys.platform!="win32" is for, and if I should change it to something else for Mac OS X. It seems to be saying sys.pla...

Geolocation API on Max OS X Snow Leopard

Has anyone written an application that uses the new location API in Mac OS X 10.6? There is a sample program that uses the same API for the iPhone OS, but the API is slightly different for Mac OS X, and Apple provides no sample program using it. Edit: I know how to use it, the API documentation is ok. It seems overly complex for simple...

Text disappears when typing long commands in zsh on OSX?

When I'm typing a command longer than around 20 characters the text disappears and the cursor moves to a different location in the terminal. How do I stop this? I find it difficult to understand what I'm doing when this happens. ...