mac

Bringing another app's window to front on Mac in C

How do I bring another app's window to front on Mac in C/C++? I have the app's pid. I found solutions for AppleScript, but I'm not familiar with AppleScript. (and also not with Objective C) Thanks! edit: I cannot use Carbon in this program, because it must be a 64 bit binary. edit2: I'm also interested in Carbon and Cocoa solutions. I c...

Problem encoding accented characters with python

I'm having trouble encoding accented characters in a URL using the python command line. Reducing my problem to the essential, this code: >>> import urllib >>> print urllib.urlencode({'foo' : raw_input('> ')}) > áéíóúñ prints this in a mac command line: foo=%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1 but the same code prints this in window...

What are some practical uses of Lua in Mac OS X?

I see many text editors for Mac OS X that support Lua syntax highlighting, but I have yet to see an example of Lua being used in action in the actual Operating System. How is Lua being used practically? ...

How to wake from sleep programmatically?

I want to wake system from sleep programmatically, is there any way to do this? I have read following link: http://developer.apple.com/mac/library/qa/qa2004/qa1340.html this only talk about getting notification , but not sure is there any way to wake system from sleep? I appreciate some thread to the information... Update: As per th...

how to autoscale a pdf document in mac/safari enviornment?

I am creating PDF file using ItextSharp V1.1.4322 in ASP.NET Version 2.0. Everything works fine in IE/FF/Safari browsers in windows as expected. In mac/Safari PDF file opens correctly but printout is wrong, cutting page contents. I want the page to auto scale automatic as in windows. ...

Invalid context when rendering with CIContext

I have a NSView that renders some CoreImage stuff in drawRect: method. Everything works fine while I'm rendering on hw-accelerated context, but if I switch to software mode, I have error messages in console for each render: <Error>: CGBitmapContextGetBitsPerComponent: invalid context 0x1084740 This isn't a bitmap context. Forcing destin...

Why is the font size in Safari on Mac OS so much smaller?

I have a website which uses CSS for all of its styling, and in Windows, the line-spacing and font sizes are all consistant accross Firefox, Opera, IE, Safari, Chrome. I have just tried it under Firefox on the Mac (Snow Leopard) and whilst the fonts generally look a little more bold than on windows, the general sizing looks about the sam...

Paraview and Python on Mac OSX

I've installed the binary distribution of paraview on OSX. When running this I can access the python interpreter from the Tools -> Python Shell. However I cannot figure out which libraries I need to add to PYTHONPATH in order to access VTK and Paraview functionality directly from Python. Of course I could just compile the source distrib...

Turning a screen into a virtual web cam.

Is there an app (preferable a Mac app) that will turn an area of your screen into a virtual web cam, such that it would be available as an input source for other apps that want to access your web cam? ...

What's the modern equivalent of GetNextEvent in Cocoa?

I'm porting an archaic C++/Carbon program to Obj-C and Cocoa. The current version uses asynchronous usb reads and GetNextEvent to read the data. When I try to compile this in Objective C, GetNextEvent isn't found because it's in the Carbon framework. Searching Apple support yields nothing of use. EDIT TO ADD: Ok, so what I'm trying ...

How to hide "Preferences" item in Mac application menu

I have an application built atop the Eclipse rich-client platform. It does not yet have any user preferences. Currently on the Mac, the "Preferences" menu item in the application menu is enabled, but does nothing. Is there an easy way to hide or disable it? ...

What is the internal structure of an Interface Builder .xib file?

I'm curious, can anyone describe the internal structure of a .xib file used by Interface Builder? ...

How to set fixed depth levels in DOT graphs

I'm creating a DOT graph visualization from a tree-like data structure but am having difficulties setting fixed level depths based upon data type. For example, if I had 4 nodes in a tree and A denotes a specific data type and B represents another it would like Graph_1: ROOT ...

Lazy symbol binding failed when linking C++ dynamic library

I'm writing a dylib in C++, but when I try to link it into my application, it gives me an error on execution: dyld: lazy symbol binding failed: Symbol not found: __ZN8Vector2DC1Ev Referenced from: /Users/noahz/Desktop/Singularity/Singularity Test App/build/Debug/Singularity Test App Expected in: /Users/noahz/Desktop/Singularity/Sing...

Compiler problem in a (very) simple C++ program that gets numeric input from a file.

#include <iostream> #include <fstream> #include <cstdlib> using namespace std; const int FILENAME_MAX=20; int main() { ifstream input; char name[FILENAME_MAX + 1]; int value; do { cout << "Enter the filename (maximum of " << (FILENAME_MAX+1) << " characters: "; cin >> name; input.ope...

Finding a file's directory address on a Mac...

I am working with a Macbook programming python. What I want to know is how I can access certain files using Python's file functions. A google search failed me. For example, Windows would be something like this: f = open(r'C:\text\somefile.txt') How would I access something from a folder saved on the Desktop of a Mac? ...

How to open an app from a browser?

Amazon has the button that opens an app as follows. Clicking this button opens a 'Amazon Kindle', for my case, 'Amazon Kindle for Mac'. How is this possible? I mean, how can I program to do this job? It's definitely not Flash. I tried to use button to open an App using button provided by HTML, but I couldn't make it because of the s...

where to download SVN for Mac OSX 10.4.11 ?

I'm having a lot of trouble finding SVN for Mac OS X 10.4.11. Would someone please point me to the binary I can download? Thanks! ...

OSX Custom extension icon Association

I'm trying to get my application to display an icon for a custom file extension using the following code: <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>My Custom Extension</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <...

Core Data cloud sync - need help with logic

Hi, I'm in the middle of brainstorming a cloud sync solution for a Core Data app that I am currently developing. I'm planning to open source the code for this once its done, for anyone to use with their Core Data apps, so input from the community on how this system should work is much appreciated :-) Here's what I'm thinking: Server S...