osx

Using Mac-style dock menu in an application. Illegal?

I was planning to use a dock menu similiar in looks and behavior to the Mac OS X dock menu in an application. It seems that apple have patented their dock about a year ago. I've seen some websites that use a similiar dock, the article also lists a few applications that use a similiar style. What is the legal stand of this? Is this a vio...

IOBluetoothHostContoller in 10.5

The following code compiles fine when compiling as Mac OSX 10.6 as the active SDK (linked with the 10.5 frameworks, 10.5 set as the base SDK) IOBluetoothHostController *controller = [IOBluetoothHostController defaultController]; However, if I compile it with Mac OSX 10.5 as the active SDK, I get an error message saying that IOBluetoot...

Capturing Groups From a Grep RegEx

I've got this little script in sh (Mac OSX 10.6) to look through an array of files. Google has stopped being helpful at this point: files="*.jpg" for f in $files do echo $f | grep -oEi '[0-9]+_([a-z]+)_[0-9a-z]*' name=$? echo $name done So far (obviously, to you shell gurus) $name merely holds 0, 1 or 2...

Compiled FreeImage from source. #include FreeImage.h not found.

I have compiled FreeImage 3.10.0 from source at /lib/FreeImage on Mac OS X 10.6. I can see that after compilation these files were copied: /usr/local/lib/libfreeimage-3.10.0.dylib /usr/local/lib/libfreeimage.a /usr/local/include/FreeImage.h CMake cannot find FreeImage, but I cannot even do #include <FreeImage.h> // not found I am...

Using VTK 5.4.2 with Java in OS X 10.6

Has anybody successfully ran any Java code using VTK 5.4.2 under OS X? I've installed VTK 5.4.2 from source, configured for Java and shared libraries. The vtk.jar file is generated as expected, and the Java program compiles correctly. However, when executing, as soon as the wrapper classes call the underlying *.dylib libraries, it appe...

Special characters in OSX filename ? (Python os.rename)

I am trying to rename some files automatically on OSX with a python script. But I fail to work with special characters like forward slash etc.: oldname = "/test" newname = "/test(1\/10)" os.rename(oldname, newname) I think I do have an encoding problem. But different tries with re.escape or using UTF-8 unicode encodings havent been su...

macos : list windows and detect new windows

Hello, I would like to have a list of windows which is quite simple but I need as well to : be notified when a new window appears be notified when an existing window dissapears detect when positon / size of windows change Do you have any ideas for this? Thanks in advance ...

Power Management API for auto-wake in OSX?

Hey, I need to write a program for OSX that will cause my macbook pro to wake up after a certain amount of time of sleeping. SleepX is almost perfect for me, but I want it to only go back to sleep if noone is moving the mouse/hitting the keyboard, etc.... I tried using the approach in the "wakeFromSleep" example in the Mac power manage...

Using CFBooleanRef through JNA

I'm using JNA to call Carbon APIs. The particular API call that I want to call takes a CFBooleanRef as a parameter. The values, kCFBooleanTrue and kCFBooleanFalse, are declared as direct extern references in the header files. How can I get references to those two values on the Java side, so that I can pass the values to the API call ? ...

NSURLConnection - Is it possible to wait/block on a request?

Hi All, I need to wait for a response from a SOAP webservice, I am calling via a NSURLConnection as I need to manipulate the data being returned and then return it from my class to the calling class. I cant figure out how I can possibly do it. Here is my code at the moment: #import <Foundation/Foundation.h> @interface UsersBLL : NSO...

Git core.editor on Mac OS X

How can I change the core.editor of Git to start a program such as Smultron? All I can find are examples for terminal editors or TextMate. ...

#include <FreeImage.h> not found

I have compiled FreeImage from source and installed it. When I run sudo make install in installs the following files on my system /usr/local/include/FreeImage.h /usr/local/lib/libfreeimage-3.10.0.dylib /usr/local/lib/libfreeimage.a However in my C++ program it says error file not found when I do this: #include <FreeImage.h> I have...

Parsing and Writing XML in MAC 10.3.9 Cocoa?

Hi, What is the Best way i can do Parsing or Writing into XML using cocoa for mac10.3.9.? Im mentioning the version of OS specifically because, i read in the documentation like, Mac 10.3.9 sdk does not support NSXML class.? I Found an OpenSource libaray (libxml), is it the only library i can use???? Please give me some suggestion regar...

How to make distributed builds using XCode 3.2 on OS X 10.6

After I upgraded using a clean install from OS X 10.5 to 10.6.2 and upgraded the XCode to 3.2.1 I wasn't able to use distributed builds feature anymore. There are several issues that I detected: In most cases Bonjour is not detecting the other computers even they are on the same switch. I added a custom 'set' where I added manually th...

How can i be notified that the user is logging out?

Hi, I am writing a user agent that needs to perform some cleanup when the user logs out of OS X. The agent is NOT receiving a SIGINT (neither SIGTERM, and neither SIGKILL) signal. Because of this, the agent process is remaining as a "ghost" process running on the Mac, and it will no longer respond to any attempts I do to kill it. I n...

Core data and custom NSCell

I am building a toy app using core data for two entities Log (attributes text and date) and Tag with a many-to-many tags relationship from Log to Tag. I want to show logs in a table, so I: created an NSArrayController instance, LogController in IB with entity set to Log (pic) created a one-column NSTableView whose column is bound to ...

How to programmatically make cocoa application active

Hi all - I've got a background process that makes a transparent window appear when a hotkey is pressed: [window makeKeyAndOrderFront:nil]; [[content animator] setAlphaValue:1.0]; // alpha was 0.0 ... the window shows up fine & in front of the other windows (as I want it to), however until I manually click the window whatever applicati...

USB on Mac (how to use digital to analog converter on mac with cocoa)

Hi I have to play an audio file on digital to analog converter (Silverstone digital to analog converter Model number DB01S) on Mac ox x 10.6 with cocoa. I used USBSimpleExample from apple but i am always getting this error "dealWithInterface: unable to open interface. ret = e00002c5" Any help would be appreciated! Thanks ...

Starting Python script without explicitly having X11 open

I had Python v2.3 on my system. When I wanted to run a Tkinter script I could just use python myscript.py I recently upgraded to Python 2.5 and now I need to have X11 running and the "DISPLAY" environment variable set before I can run any of my scripts. This is bad for me, because I can't distribute any scripts without explicitly stat...

What's an easy way to have terminal use a different color based on ssh host name?

Using putty in windows, you can save sessions that connect to a certain host and use a certain text color...this was super useful for me since I work with a bunch of remote hosts and I'm wondering if there is (there must be) a way to get Terminal (in Snow Leopard) to emulate this behavior. I'm wondering how I would 1. Save a connection...