osx

OS X: Setting at runtime the Application name as it appears in Dock and Menu Bar

I have an app that may get launched with current user's or with root permissions. In fact, there's the possibility that the app runs twice at the same time - once under the current user and once as root. I like to inform the user when the app is running under root. Currently, I show this in its window title, but I'd prefer to change th...

Snow Leopard Style Pop-Ups

Is there a framework that draws Snow Leopard style popups? For an example of what I am talking about, try right clicking something in the dock. I basically want to be able to give a starting point (where the arrow forms) and then a size and have it do the rest. In this case it's a menu, though my use would be more of just for drawing a ...

How to convert ASCII character to CGKeyCode?

I need a function that, given a character, returns the CGKeyCode associated with the position of that character on the current keyboard layout. E.g., given "b", it should return kVK_ANSI_B if using U.S. QWERTY, or 45 if using Dvorak. The Win32 API has the function VkKeyScan() for this purpose; X11 has the function XStringToKeySym(). Is t...

Confusion with popUpMenuPositioningItem:atLocation:inView:

The documentation for this method says: "Pops up the menu at the specified location." but the pamameters seem to describe a different situations: item The menu item to be positioned at the specified location in the view. location The location in the view coordinate system to display the menu item. view The view to display the menu it...

Using Qt in a pre-existing x-platform project?

I have an existing cross platform project that runs on Mac, Linux and Windows. Now, I want to add a 'native' UI to it - the ability to show some popup windows (to request user credentials) and perhaps FileOpen dialogs. By native I mean I want to use the systems build in file-open dialog - so on the Mac the mac file finder is shown and ...

How to programmatically set volume in Windows, Mac and Ubuntu?

I'd like to programmatically set volume in Windows, Mac and Ubuntu using C/C++. Command line also can but C/C++ preferred. Thank you in advance! ...

SQLite3 problem since Rails 2.3.5 update

Hi, I was running Rails 2.3.4 with SQLite3 on a Snow Leopard box without any problems. I've just done a pull on a new project that requires 2.3.5 so I did a sudo gem update to get the latest version of Rails. This installed fine but when I ran rake db:migrate I got the following error: rake aborted! uninitialized constant SQLite3::Driv...

Mac OS X Debug Error

On startup of my application with gdb, I am getting weird errors that look like: unable to read unknown load command 0x22 The whole trace looks something like this: [Session started at 2009-12-17 10:28:24 -0500.] GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009) Copyright 2004 Free Software Foundation, In...

Trouble installing/compiling lua on macosx

I have been attempting to compile/install Lua on Snow Leopard. I have changed the target platform in the Makefile.std to macosx and I still get the following issue: sudo make -f Makefile.std macosx make[1]: *** No rule to make target 'macosx'. Stop make: *** [macsox] Error 2 I also changed the target of the same Makefile.std file in ...

[OS X] What can cause dlopen: no suitable image found (can't map)?

What can cause the following error when loading an additional bundle using dlopen: dlopen($(OBJ_DIR)/Test-20091217211256.ob, 6): no suitable image found. Did find: $(OBJ_DIR)/Test-20091217211256.ob: can't map Before this error, the process allocates large amounts of memory. (Substituted $(OBJ_DIR) in the error for the actual pat...

Programatically instantiating a NSPopUpButtonCell in Cocoa OSX

I have an openGL GUI interface and I need to have a popup menu that will be called when this a certain button is pressed in my openGL display. I want to display a menu similar to the one that pops up when you press an NSPopUPButton but I cannot use the Cocoa button itself. It seems that the best way to accomplish this is to use the NSP...

Equivalent of strace -feopen < command > on mac os X

This is useful for debugging (hence programming related). On linux, we can use the command strace -feopen python myfile.py to figure out which python modules and shared objects are loaded. Is there an equivalent one-liner on macOS X? ...

Building a Java EE app on Mac OS X Snow Leopard for Glassfish 3

I'm having a bit of a problem building a Java Enterprise Edition web application on Mac OS X 10.6.2 using Ant 1.7.1, Glassfish v3 and Java EE 6. The problem is that the build process does not find the Java EE libraries which fair enough as I don't think Apple supply them with the default Java installation but I know they exist in the Gl...

Using Apple Scripting Bridge in C

I'm wondering if it is possible to use Scripting Bridge (as discussed here) in C. What I'm trying to do is control and/or get information from Apple applications (such as iTunes, see link listing 2.1 & 2.2 on above link) which is fairly easy using Objective-C. I could write those parts in Objective-C using C, but that would get pretty c...

Applet freezes page on initial load (Mac Firefox)

We have a web screen with a number of applets that has a problem on Mac OSX 10.5.7, Firefox 3.0.15, java 1.5.0_19. The problem is encountered on the user site. On initial load of applets (with an empty applet cache), the screen locks up/hangs while loading the applets. After refreshing the page, it loads normally. If the cache is clea...

User-friendly checksum validation on Mac OS?

I'm not entirely sure if this a SO or SF question, but I'll give it a go here. We're offering DMGs for download and a MD5 checksum to go with each. The question is how to instruct users of how to actually checksum and compare with the given checksum. Users aren't going to be all that tech savvy. One idea was to produce a copy-paste bas...

Streaming live video to a web site

Hi, I've received a request asking if it's possible to stream live video to a web site. The person requesting this has a notebook running MacOS, a professional camera that can be connected up using Firewire and a web site with PHP/MySQL. What solutions exist to stream the video out on the Internet and, if practical, what would be neces...

SVN Mac - Stripping files of SVN meta data?

I downloaded some source files on a Mac that were previously part of some working copy on the authors computer, I need to use these files in another repository but the SVN client "Versions" for Mac is picking up on the data from this old repository. I can't find the ".SVN" folder anywhere... any idea on how to "cleanse" these files so I ...

Amazon EC2 instance

Hi, I have setup an amazon EC2 intance using the command line tools. I have create a key pair for it etc. and it is up and running. I try to SSH into it using the following (I am running bash in Snow Leopard): $ ssh -i ec2-keypair [email protected] Snow Leopard pops up a box saying "Enter you password for ...

How do I add the symfony utility to my PATH variable?

I'm running the latest MAMP (i think so) on my Mac (10.5.8, PPC G4) and i added the following to my .profile - file in my home directory: export PATH=/Applications/MAMP/htdocs/lib/vendor/symfony/data/bin:$PATH But my Terminal is somehow unable to find the command, and all i get is the following errors: : command not found : command n...