osx

is there a way to eject all external hard drives from the command line? (OS X)

Is there a way to eject all the mounted hard drive volumes on an OS X computer from the command line? Applescript is OK if I can wrap that in a shell script. ...

java.lang.NoClassDefFoundError: com/google/common/base/internal/Finalizer$ShutDown (wrong name: com/google/common/base/internal/Finalizer)

Our application uses the MapMaker class from Google collections, and we're getting the exception below, but only on OS X 10.4 using webstart. It works fine when launched from an app bundle, and on OS X 10.5 and Windows. This has started happening since our upgrade from RC2 to RC5 (we skipped all the intervening versions). We've since ...

pbcopy does not seem to work within a gnu screen window in OSX

On my OS X Leopard Macbook Pro, I try to pipe text or redirect a text file into pbcopy. It works when I do this in the Terminal, but not if I do it in the Terminal when I'm working in a Gnu screen window. Is this a bug or is there a workaround? ...

OS X text drawing

As I (semi) understand it, all on-screen text in any Windows application is drawn by the same drawtext functionality. It is possible to hook onto this method and view (or even change) every bit of text being drawn to the display. How does OS X put text on the screen? Is there a similar way to hook into this API and view all text being...

Can AWT file choosers not access Aliases in OSX?

I need to use AWT file choosers for my java app because we want to give users the native mac file chooser. Yes I know abut quaqua and we use it, but it does not use the native file chooser and mac users do not like it. The file chooser I am currently worried about sets the global propery: System.setProperty("apple.awt.fileDialogForDir...

Using a Linker Script on Mac OS X

Is there any way to use a linker script with ld on Mac OS X? The GNU ld program on Linux accepts a -T <scriptname> option, but on Mac OS -T is an unknown command option. Using an alternative installation of GCC is okay with me, if that solves the problem. ...

Downgrading to pyobjc 2.0 from pyobjc 2.2

I accidentally installed pyobjc 2.2 with easy-install pyobjc, and it's causing problems: When I try to import it I get the error Incompatible library version: _objc.so requires version 10.0.0 or later, but libxml2.2.dylib provides version 9.0.0 I'm not interested in fixing that though, all I want is my pyobjc 2.0 back. I've tried rem...

Why is Apple's gcc output mixed up when compiling for multiple architectures?

When running gcc on the command line in OS X, every now and then, I'll get warnings and/or errors. But I'm always compiling for multiple architectures (with the -arch option), and since gcc spawns several processes for each architecture, errors will constantly get garbled. For example, just running gcc (options) -### will result in Usin...

Export 2 min QuickTime movie clip in Cocoa

I want to know how to export a 2 minute QuickTime movie in Cocoa. ...

Linking error: Undefined Symbols, lots of them (cpp cross compiling)

Hello, I get to the very last linking command (the actual executable is being linked) but i get a BUNCH of undefined symbols (and they're in cpp and look so scary to me, a simple c programmer) --its probably something simple but i cant get what im supposed to put as linker (its using gcc here...? is that appropriate? g++ told me too ma...

How to display a modal message box in C++ on Mac?

CFUserNotificationDisplayAlert and CFUserNotificationDisplayNotice creates a non-modal window and this is bad because it could bring your application UI in a very undesired state if you select the original application window (the message box is hidden but the applicaton does not respond). The old SystemAlert was modal but this one doesn...

backporting NSWindowDelegates windowDidEndLiveResize behaviour in OSX 10.5?

While 10.6 introduced the neat - windowDidEndLiveResize: et al for NSWindowDelegate, i need similar behaviour in 10.5 to avoid constantly invoking heavier functions via - windowDidResize:. Currently i can only think of a timer-based solution (i.e. checking in short intervals for when the last resize occured), which seems ugly. Is there ...

Creating a "Uninstaller" for a program on Mac OS.

I have a requirement to create a cross platform application that launches a web link to a feedback form when its uninstalled. This is obviously normal sort of behaviour on windows..., but on a Mac is is proving to be more complicated as applications are not technically installed and uninstalled in a windows sense, aka you just copy the ...

how do you open a PDF at a specific page from the command line? (OSX or Linux)

I want to open a PDF document at a specific page from the command line, sort of like vim +n [file]. Is there any way to do that in OSX, with any PDF reader program? ...

OS X Mac and writing a twain scanning application.

Can someone point me to the correct place to start development of a twain scanning appliation for the MAC osx. I have done some simple objective c development in the past, but nothing interfacing with a device. ...

How to add trusted sites to the Application Layer Filter (socket-filter firewall) on Mac OS X using command-line?

Hello, I am trying to add trusted sites to Mac OS X's firewall via command-line. I understand that previously, we were able to use ipfw to configure the firewall on a packet level by using port numbers or IPs. In Leopard (10.5) and on, there is a new feature to add a trusted application to a list. This can be accomplished using the U...

How to remove maximize button in Mac OS X tool window in Qt

I have a floating tool window. It works fine on Windows, but I can't get rid of the maximise button on Mac OS X. I have tried unsetting Qt::WindowMaximizeButtonHint and setting the window to fixed size. Nothing seems to work. MyWidget::MyWidget( QWidget* parent ) :QWidget( parent, Qt::Tool | Qt::CustomizeWindowHint ) { setupUi( th...

Copy Table data from one DB to another

For development I find myself needing to copy table information from one table to another quite often. I am just curious what are the easiest solutions to do this for Postgres. I have PGAdminIII but it looks like it really only support the long drawn out Backup/Restore. Is there a python or bash script somewhere or something that I ca...

Swing on OSX: How to Trap command-Q?

After being convinced ("schooled") that Swing apps on Mac do look native, I'm trying to make mine look as native as possible. Everything looks great, but when I hit command-Q or do it from the menu, my windowStateChanged(WindowEvent e) is not firing on my main JFrame (if I exit in any other way, it does fire). How can I respond to the re...

bus error in simple Mac OSX C program

I am writing a simple C program to create a twelve tone matrix. The code compiles, but I get run time error 'Bus Error'. In the debugger it says EXC_BAD_ACCESS. int main () { int j,k,l; int twelve[13][13]; void mat(int twelve[13][13]); printf("input original tone row \n"); for(j=0;j<=11;j++) { scanf("%2i...