osx-mountain-lion

How to know what Mac OS the app is running on?

家住魔仙堡 提交于 2019-12-08 23:29:15
问题 I've seen in some projects something like: #if ..... code... #endif but i can't find it now... Let's say, for example, if the app is running on 10.8 the app does 1 thing, if not the app does other thing. Whats to code to check if it's running on 10.8? Thanks. 回答1: You're probably asking the wrong question. Except in very rare cases, you should not care what system version the user is running. Instead, you should be checking if the specific thing you're interested in is available. For instance

Annoying message when opening windows from Python on OS X 10.8

落爺英雄遲暮 提交于 2019-12-08 22:51:00
问题 Whenever I run a Python script that opens any kind of window on OS X 10.8, whether it's a GLUT window or a QT one or anything else, I get a message that looks like this: 2013-09-11 14:36:53.321 Python[3027:f07] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/0x/25_70mj17tb1ypm1c_js8jd40000gq/T/org.python.python.savedState I use python2.7 installed via MacPorts. This is a minor annoyance, but I'm curious to know what the message means,

Call a command in terminal using Java (OSX)

假如想象 提交于 2019-12-08 12:45:48
问题 I am trying to write Java code to run wget to retrieve an image from a server I believe that I have wget properly installed. If I type: wget http://insitu.fruitfly.org/insitu_image_storage/img_dir_38/insitu38795.jpe I find the image in my user account folder. The following Java code was working properly on Ubuntu, but I had to move the project over to OSX (Mountain Lion) import java.io.*; import java.io.IOException; public class runWget { public static void main (String args[]) { String

Two Finger Drag with IKImageView and NSScrollView in Mountain Lion

瘦欲@ 提交于 2019-12-08 10:38:19
问题 I have a Mac App that's been in the app store for a year or so now. It was first published with target SDK 10.7, Lion. Upon the update to Mountain Lion it no longer works. The application displays large images in an IKImageView which is embedded in an NSScrollView. The purpose of putting it into a scrollview was to get two finger dragging working, rather than the user having to click to drag. Using ScrollViewWorkaround by Nicholas Riley, I was able to use two finger scrolling to show the

How do I build PIL on OS X Mountain Lion?

↘锁芯ラ 提交于 2019-12-08 07:41:00
问题 When I try to build PIL on Mac OS X 10.8.1 Mountain Lion, I get the following result: $ sudo python setup.py install Password: running install running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall

Running wxPython 2.9 on OS X 10.8 (64 bit)

时间秒杀一切 提交于 2019-12-08 07:08:44
问题 I have EPD 7.3 and have installed wxPython 2.9 through the Enthought repositories. I tried running winPDB, which requires wxPython and I got this message : This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac. I have seen similar messages from wxPython on Mac, but I haven't found a solution yet. Does anyone know about this message? And, has anyone got WinPDB to work on OS X 10.8 w/ wxPython 2.9?

Apple OSX OpenGL offline rendering with CoreGL

≯℡__Kan透↙ 提交于 2019-12-08 06:41:28
I'm trying to render on OSX using CoreGL and a Framebuffer: it seems that the triangle rendering is not working at all, while for example a glClear with a color will be shown in the resulting PPM image. I've tried several variation of the code below, but right now it seems to me that this is an impossible task on OSX. #include <stdio.h> #include <OpenGL/OpenGL.h> #include <Opengl/glext.h> #include <stdlib.h> #include <assert.h> #include <opengl/gl3.h> int main(int argc, const char * argv[]) { CGLContextObj context; CGLPixelFormatAttribute attributes[13] = { kCGLPFAOpenGLProfile,

Apple OSX OpenGL offline rendering with CoreGL

落爺英雄遲暮 提交于 2019-12-08 06:19:22
问题 I'm trying to render on OSX using CoreGL and a Framebuffer: it seems that the triangle rendering is not working at all, while for example a glClear with a color will be shown in the resulting PPM image. I've tried several variation of the code below, but right now it seems to me that this is an impossible task on OSX. #include <stdio.h> #include <OpenGL/OpenGL.h> #include <Opengl/glext.h> #include <stdlib.h> #include <assert.h> #include <opengl/gl3.h> int main(int argc, const char * argv[]) {

CIImage drawing EXC_BAD_ACCESS

六眼飞鱼酱① 提交于 2019-12-08 02:34:08
问题 So, I have a CIImage that I'm attempting to draw in an NSView 's -drawRect method. This is the line of code that I call to draw the image: [outputCoreImage drawInRect: [self bounds] fromRect: originalBounds operation: NSCompositeSourceOver fraction: 1]; outputCoreImage , originalBounds , and [self bounds] are all non- nil , and indeed are their respective expected values. On Lion (OS X 10.7), this worked fine, however on Mountain Lion (OS X 10.8) I receive an EXC_BAD_ACCESS on this line. If I

Mountain Lion change php location

只谈情不闲聊 提交于 2019-12-08 01:55:06
问题 After upgrading to Mountain Lion I used this one line bash script to install php 5.4 http://php-osx.liip.ch/ It installs 5.4 to /usr/local/php5 If i run which php I get /usr/bin/php And running php -v returns 5.3.13 How do tell Mountain Lion to use the php in /usr/local/php5 Will I also have to change Apache htttpd.conf to use the new version of php? Thanks 回答1: This is the hard way, you just link to the new php file: $ sudo mv /usr/bin/php /usr/bin/php53 && sudo ln -s /usr/local/php5/bin/php