osx

Preventing an application from being moved between spaces

Working on an application that contains legacy Carbon code (mixed with some Cocoa). It is a full screen app (not technically, it just draws itself as though it were) that hides the dock and application menu bar when active. What I'd like to do is prevent the application from being allowed to move between Spaces. Basically, if the user a...

Distribute binary library on OSX

I'm planning to release some compiled code that shall be linked by client applications on MacOSX. The distribution is some kind of code library and a set of header files defining the public interface for the library.The code is internally C++ but its public interface (i.e what's being shown in the headers) is completely C. These are my...

Installing new libraries on an OS X machine via terminal

I'm looking at using the tre tool provided at http://laurikari.net/tre/. I'm trying to install it on my Mac OS X box via the terminal. I've followed what I believe to be the regular path to install a new library - ./configure, sudo make, sudo install. Everything seems to go swimmingly. When I then go to access the library in c, I rec...

How to create an overlay window in Java?

I'm trying to create a HUD style display for a foreign application. To do this, I'd need to make a transparent overlay window, that would be placed on top of the window of the foreign application. The overlay window should allow me to place widgets and draw text on it. Events should get forwarded to the underlying window, if they happen...

How to make python_select work for '$>python' command?

I installed a couple of pythons in different versions with macports, and the apple python 2.6 is also working. Now I need to run a program which requires MySQLdb package support in python, and this package was installed to the python I installed by macports. The program tells me that there is no MySQLdb installed, so I guess it is the ap...

Code to record a screencast in MacOS

I need to write a tool that records screen activity on a MacOS desktop and creates a video of it. I'm aware that there are multiple tools available that do this already - yet I need an implementation of my own for various reasons. As the issue is a very broad one I will break it down into the following: a) What technologies/skills wou...

File-level filesystem change notification in Mac OS X

I want my code to be notified when any file under (either directly or indirectly) a given directory is modified. By "modified", I mead I want my code to be notified whenever a file's contents are altered, it's renamed, or it's deleted; or if a new file is added. For my application, there can be thousands of files. I looked as FSEvents...

Does this function IOHIDManagerRegisterDeviceMatchingCallback operate under the cocoa environment?

Hi, I am struggling to implement an HID control with a Mac : I cannot send the expected function as depicted here below: IOHIDManagerRegisterDeviceMatchingCallback( gIOHIDManagerRef, Handle_DeviceMatchingCallback, NULL ); with : gIOHIDManagerRef -> the valid HID manager dedicated to this routine Handle_DeviceMatchingCallback --...

How to compress jpeg image with Cocoa?

I have an jpeg image and I want to be able to incrementally compress it using Cocoa/Core Image/Core Graphics. For example, I have A.jpg (3MB), I compress A and get B.jpg (1MB), compress B and get C.jpg (400KB), and so on till the image can't be compressed anymore. I am trying to use NSBitmapImageRep representationUsingType:properties w...

Cocoa application crashing on OpenGL call

I made a new project and pretty much copied this guide, but whenever I call any OpenGL function it the spot marked // Drawing code here it crashes. I have this there : glViewport(0, 0, [self bounds].size.width, [self bounds].size.height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, [self bounds].size.width, [self bounds...

Core Data Migration error message "'Model does not contain configuration 'XYZ'.'"

I have a Managed Object Context to which I add two different SQLite stores. I use Configurations in the Mananged Object Model to assign certain entities to one store and other entities to the other. The Configurations are called "UserDB" and "MainDB". Everything works okay until I try to use automatic migration. After creating a new Man...

Unable to use PIL after installing using pythononmac.org package (Mac OS Leopard)

I'm trying to use PIL for a Google App Engine project. I've installed PIL using the installer from pythononmac.org but it doesn't seem to do anything, or at least neither I nor Python can find the files. I'm running Python 2.5.1. ...

How to cross compile from Mac OS X to Linux x86?

Hi, I'm running Mac OS X 10.5.8 and want to compile for target CentOS 5.3 with GCC 4.1.2. How could I: Compile GCC 4.1.2 toolchain and related tools? Use that tool to cross compile for target CentOS 5.3? Any help is greatly appreciated! ...

Using Python 3.1 with TextMate

TextMate seems to use the built-in Python version I assume (sys.path doesn't work). How do you configure it to use 3.1 instead? I've already installed the 3.1 package and I can use IDLE for interactive sessions, but I need to use TextMate now. Thanks ...

How to program a mouse click on Mac OS X and on Linux?

I know how to program a click on Win32 (click on the screen programmatically) using C or Ruby. Does anyone know how to do it on Mac OS X and Linux just as a comparison? thanks. ...

OSX Quartz Event Taps: event types and how to edit events

Here's my code: #import <ApplicationServices/ApplicationServices.h> CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { printf("%u\n", (uint32_t)type); return event; } int main (int argc, const char * argv[]) { CFMachPortRef eventTap; CFRunLoopSourceRef runLoopSource; even...

Possible to get the hostname of an IP using SystemConfiguration?

I'm using the SystemConfiguration framework to get the current IP from the dynamic store in my app. Is it possible to get the hostname from the dynamic store as well? The current IP could be local, so I'm trying to get the returned value to be something like "mymac.local" or "2adg3.dsl.lgtpmi.sbcglobal.net", depending on how I'm connect...

Parser for 32-bit and 64-bit Mach-O binary/executable formats in C++

I'm looking for a C++ library that can parse 32-bit and 64-bit Mach-O binary format. I don't need anything fancy, just a disassembly and splitting the file into its sections, so no decompilation, name demangling and so on. I know I can either rip open any existing disassembler or craft my own binary parsers using the format specificatio...

Unicode support in Web standard fonts

I need to decide whether to render geometric symbols in a web GUI (e.g. arrows and triangles for buttons, menus, etc.) as Unicode symbols (MUCH easier and color-independent) or GIF/PNG files (lots of hassle I would like to avoid). However, I have seen Windows clients that have trouble displaying even advanced punctuation symbols declare...

Why does Rake crash my Mac OSX ?

Hi ! I'm running Mac OSX 10.6.2 and I've got a strange problem with rake and my ruby applications. Has soon as I launch a rake command my mac crashes and ask me to reboot (dark screen). This occure when I try to run a Rakefile or even simply if I type: rake --version I tried reinstalling rake by running the install.rb file of the lat...