Re: Making a window topmost within an application

2011-01-06 Thread Quincey Morris
On Jan 5, 2011, at 23:15, deovrat singh wrote: > In my application,I have a set of windows.I want one of the window to be top > most all the time when the application is active.I tried doing this by > changing the level of the window, but didn't succeed. You probably want a NSPanel with its "isFl

Re: Making a window topmost within an application

2011-01-06 Thread Seth Willits
On Jan 5, 2011, at 11:15 PM, deovrat singh wrote: > If I put NSNormalWindowLevel , then on clicking any other window of my > application this window goes in background.While if I use any other level > than NSNormalWindowLevel , then the window remains topmost even if I switch > to some other appli

Re: execute system("some script") on behalf of root from non-root app

2011-01-06 Thread glenn andreas
Executing arbitrary scripts as root is also a potentially major security hole. Your goal should be to do as little as possible as root (or other elevated privileges), and with as little flexibility as possible. Security is hard, and if you don't understand the issues, you should take a step

Re: Application that uninstalls itself

2011-01-06 Thread James Bucanek
eveningnick eveningnick wrote (Tuesday, January 4, 2011 10:55 AM -0800): Thanks everyone for advices! 2011/1/4 James Bucanek : In my application, I have a special "Uninstall and Quit" menu item. I shutdown and delete launchd configuration files and them move the

Re: execute system("some script") on behalf of root from non-root app

2011-01-06 Thread eveningnick eveningnick
>Search google is not an answer, although a good suggestion. Could you please >post the solution you came up with to the >list. There are many ways to skin >this cat, I think we would all benefit from your experience. Every process that is running on a system has two user id numbers - effective

Re: Question regarding popoverControllerDidDismissPopover: delegate method

2011-01-06 Thread Matt Neuburg
On Wed, 5 Jan 2011 17:20:19 -0800, Jon Brooks said: > >The problem comes if a user simultaneously taps both an item in the popover, >and outside the popover. In this case, I first get the delegate, >popoverControllerDidDismissPopover: which is fielding the tap outside the >popover, followed b

Re: execute system("some script") on behalf of root from non-root app

2011-01-06 Thread eveningnick eveningnick
> Executing arbitrary scripts as root is also a potentially major security > hole.  Your goal should be to do as little as possible as root (or other > elevated privileges), and with as little flexibility as possible. > > Security is hard, and if you don't understand the issues, you should take a

Re: Stupid png icons

2011-01-06 Thread Matt Neuburg
On Wed, 5 Jan 2011 11:01:02 -0600, William Squires said: >This is in reference to earlier messages vis-a-vis png icons not displaying >correctly on UITabBarItems. > >It was suggested to make sure the icons have an alpha channel, so I reloaded >them into GraphiConverter, and set it so they would

RE: execute system("some script") on behalf of root from non-root app

2011-01-06 Thread Shawn Bakhtiar
Possibly But if we are talking about an installer, it almost always will require root access at some level. However, if your looking for a program as part of the user (not admin) experience to install and uninstall components, than you do need to be extremely careful. A user should never

Execute a pre-starting script first, when the App bundle is launched, then the main executable

2011-01-06 Thread eveningnick eveningnick
Hi I have an application, which is located in a bundle (like any other cocoa app) and can be installed in a mac-way: by dragging its bundle to /Applications (or elsewhere). I have been asked to create an "addition" to this application, that adds some functionality, but needs to be installed using

Re: execute system("some script") on behalf of root from non-root app

2011-01-06 Thread Aaron Burghardt
On Jan 6, 2011, at 11:01 AM, eveningnick eveningnick wrote: >> Executing arbitrary scripts as root is also a potentially major security >> hole. Your goal should be to do as little as possible as root (or other >> elevated privileges), and with as little flexibility as possible. >> >> Securit

Re: Event to trigger writeSelectionToPasteboard

2011-01-06 Thread Peter Watkins
Hi Graham, On Tue, Jan 4, 2011 at 2:43 PM, Graham Cox wrote: > > On 05/01/2011, at 3:04 AM, Peter Watkins wrote: > > This is what I'm really trying to achieve, "I'm writing an app that lets > the user select text in one program and paste it into another by > middle-clicking the mouse button." >

Re: Making a window topmost within an application

2011-01-06 Thread Kyle Sluder
On Wed, Jan 5, 2011 at 11:15 PM, deovrat singh wrote: > If I put NSNormalWindowLevel , then on clicking any other window of my > application this window goes in background.While if I use any other level > than NSNormalWindowLevel , then the window remains topmost even if I switch > to some other a

Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable

2011-01-06 Thread Kyle Sluder
On Thu, Jan 6, 2011 at 8:12 AM, eveningnick eveningnick wrote: > I came up with the following, which seems reasonable to me: > i will copy the pkg installer of my Addin-application into the Main > application's bundle. The user will be able to drag the bundle to > /Applications as usual, but after

Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable

2011-01-06 Thread eveningnick eveningnick
> You can't do this. The Info.plist needs to refer to the main app's > binary. Instead, put your checks into the main app's startup code. > -[ applicationDidFinishLaunching:] would be a > good place. > > This will require changes to the main app. What if i rename the Main Application's executable

Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable

2011-01-06 Thread Scott Ribe
On Jan 6, 2011, at 10:27 AM, eveningnick eveningnick wrote: > i know It looks like a dirty hack, but is it possible to do this way, > without modifying the main application (except simple renaming of its > binary)? What pitfalls could i run into, doing that? The one that comes to my mind immediat

[UIWeVview] goBack:/goForward: (correction)

2011-01-06 Thread Donald Hall
Sorry, it's not ""loadDocument:inView:"," it's "[aWebView loadRequest:request]" that works. I shouldn't post at midnight! Don Hi, It seems that these two methods work fine if the view content is loaded by "loadDocument:inView:", but don't work if the HTML data is loaded into the web view via

How to get "colored" font smoothing in a CALayer

2011-01-06 Thread James Bucanek
Greetings, The is probably more of a Carbon question than a Cocoa question, but since the problem starts with CALayer, I'll start here first. I have a file browser that works much the way the Finder does, except that I'm drawing into CALayer objects using the CTLine... family of drawing rout

Re: Event to trigger writeSelectionToPasteboard

2011-01-06 Thread Gary L. Wade
Have you thought of changing your mouse's System Preferences settings to execute a script that does what you want? It appears you should be able to use the side-buttons on a Mighty Mouse to do what you want. Otherwise, I'd contact the manufacturer of your three-button mouse and let them know of y

Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable

2011-01-06 Thread Kyle Sluder
On Thu, Jan 6, 2011 at 9:27 AM, eveningnick eveningnick wrote: >> You can't do this. The Info.plist needs to refer to the main app's >> binary. Instead, put your checks into the main app's startup code. >> -[ applicationDidFinishLaunching:] would be a >> good place. >> >> This will require changes

Re: How to get "colored" font smoothing in a CALayer

2011-01-06 Thread David Duncan
On Jan 6, 2011, at 10:28 AM, James Bucanek wrote: > Greetings, > > The is probably more of a Carbon question than a Cocoa question, but since > the problem starts with CALayer, I'll start here first. Not really since nothing here involves Carbon :). > So how can I get my text to draw as smooth

Re: How to get "colored" font smoothing in a CALayer

2011-01-06 Thread Kyle Sluder
On Thu, Jan 6, 2011 at 10:28 AM, James Bucanek wrote: > Greetings, > > The is probably more of a Carbon question than a Cocoa question, but since > the problem starts with CALayer, I'll start here first. Welcome to the madness of CALayer. I suggest you take a very long, hard look at whether you w

NSDictionary key types

2011-01-06 Thread Jon Sigman
I'm a bit new to Cocoa, and I'm trying to get my head around NSDictionary. In the Apple documentation it says, "Each entry consists of one object that represents the key and a second object that is the key's value. ... In general, a key can be any object, but note that when using key-value codin

Re: Context in GCD source cancel handler?

2011-01-06 Thread Jonathon Kuo
On Jan 5, 2011, at 12:41 PM, Dave Keck wrote: >> Q: When a context object is set with dispatch_set_context(), is it retained? >> Or do I need to retain it first, set it, and then in the cancel handler >> release it? > > The 'context' argument is not retained. You can infer this primarily > by

Re: NSDictionary key types

2011-01-06 Thread Nick Zitzmann
On Jan 6, 2011, at 1:10 PM, Jon Sigman wrote: > I'm a bit new to Cocoa, and I'm trying to get my head around NSDictionary. In > the Apple documentation it says, "Each entry consists of one object that > represents the key and a second object that is the key's value. ... In > general, > a key

Re: NSDictionary key types

2011-01-06 Thread Quincey Morris
On Jan 6, 2011, at 12:10, Jon Sigman wrote: > I'm a bit new to Cocoa, and I'm trying to get my head around NSDictionary. In > the Apple documentation it says, "Each entry consists of one object that > represents the key and a second object that is the key's value. ... In > general, > a key can

Re: NSDictionary key types

2011-01-06 Thread David Duncan
On Jan 6, 2011, at 12:10 PM, Jon Sigman wrote: > I'm a bit new to Cocoa, and I'm trying to get my head around NSDictionary. In > the Apple documentation it says, "Each entry consists of one object that > represents the key and a second object that is the key's value. ... In > general, > a key

Re: NSDictionary key types

2011-01-06 Thread Jon Sigman
So are the following two equivalent? id myKey = [NSNumber numberWithInt:8760]; if (myObj = [myDict objectForKey:myKey]) { . . . do something } and id myKey = @"8760"; if (myObj = [myDict objectForKey:myKey]) { . . . do something } From: Nic

Re: NSDictionary key types

2011-01-06 Thread Nick Zitzmann
On Jan 6, 2011, at 1:50 PM, Jon Sigman wrote: > So are the following two equivalent? > > id myKey = [NSNumber numberWithInt:8760]; > if (myObj = [myDict objectForKey:myKey]) { > . . . do something > } > > and > > id myKey = @"8760"; > if (myObj = [myDict objectForKey:myKey]) { >

Re: NSDictionary key types

2011-01-06 Thread David Duncan
On Jan 6, 2011, at 12:50 PM, Jon Sigman wrote: > So are the following two equivalent? > > id myKey = [NSNumber numberWithInt:8760]; > if (myObj = [myDict objectForKey:myKey]) { >. . . do something > } > > and > > id myKey = @"8760"; > if (myObj = [myDict objectForKey:myKey]) { >. .

LOCATING MEDIA FILES IN MACINTOSH

2011-01-06 Thread Abhinav Tyagi
Hi All, Although this querry may seem simple to you but since i dont have any idea about it, i am clueless as how to approach. Problem: Scanning the disc for media files. As the media files can be present anywhere in the disc, searching whole disc by enumerating the directory listings will be ver

Re: NSDictionary key types

2011-01-06 Thread Jon Sigman
On Jan 6, 2011, at 1:50 PM, Nick Zitzmann wrote: > So are the following two equivalent? > > id myKey = [NSNumber numberWithInt:8760]; > if (myObj = [myDict objectForKey:myKey]) { > . . . do something > } > > and > > id myKey = @"8760"; > if (myObj = [myDict objectForKey:myKey])

Re: NSDictionary key types

2011-01-06 Thread Murat Konar
On Jan 6, 2011, at 12:43 PM, Quincey Morris wrote: > The semantics of keys also requires them to be immutable (well, maybe that's > the semantics of 'isEqual:') The immutability requirement stems from needing to guarantee that keys in a dictionary are unique. If a key was mutable, it could be c

Re: NSDictionary key types

2011-01-06 Thread Nick Zitzmann
On Jan 6, 2011, at 2:03 PM, Jon Sigman wrote: > Is this what the documentation for "isEqual:" refers to when it says "If two > objects are equal, they must have the same hash value"? How do I determine > what an object's hash value is? It's the value returned from the hash property declared by

Re: Context in GCD source cancel handler?

2011-01-06 Thread Dave Zarzycki
On Jan 6, 2011, at 12:17 PM, Jonathon Kuo wrote: > > On Jan 5, 2011, at 12:41 PM, Dave Keck wrote: > >>> Q: When a context object is set with dispatch_set_context(), is it >>> retained? Or do I need to retain it first, set it, and then in the cancel >>> handler release it? >> >> The 'context'

Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-06 Thread Stephane Sudre
1) You should probably get a Google Laptop to solve this caps lock issue. 2) There's a framework for your media question: http://www.karelia.com/imedia/ On Thu, Jan 6, 2011 at 12:54 PM, Abhinav Tyagi wrote: > Hi All, > > Although this querry may seem simple to you but since i dont have any idea

Re: Context in GCD source cancel handler?

2011-01-06 Thread Fritz Anderson
On 6 Jan 2011, at 2:17 PM, Jonathon Kuo wrote: > So I can supply anything here and GCD stores it _by value_, whether its a > simple integer or even a object pointer? Taking "by value" to mean "as many uninterpreted bits as will fit into a variable of type void*," yes. — F

Re: NSDictionary key types

2011-01-06 Thread Jon Sigman
From: Nick Zitzmann To: Jon Sigman Cc: cocoa-dev@lists.apple.com Sent: Thu, January 6, 2011 1:04:47 PM Subject: Re: NSDictionary key types On Jan 6, 2011, at 1:04 PM, Nick Zitzmann wrote: >On Jan 6, 2011, at 2:03 PM, Jon Sigman wrote: >> Is this what the

Re: NSDictionary key types

2011-01-06 Thread Nick Zitzmann
On Jan 6, 2011, at 2:17 PM, Jon Sigman wrote: > Okay, I'm thoroughly confused now. What exactly is this hash value? The > documentation just says its "an integer that can be used as a table address > in a hash table structure." That doesn't mean much to me. > > Do the following two objects ha

Re: Context in GCD source cancel handler?

2011-01-06 Thread Jonathon Kuo
On Jan 6, 2011, at 1:15 PM, Fritz Anderson wrote: > Taking "by value" to mean "as many uninterpreted bits as will fit into a > variable of type void*," yes. On Jan 6, 2011, at 1:14 PM, Dave Zarzycki wrote: > Yes, that is the nature of void *. Nothing can be known about a void * other > than th

Re: NSDictionary key types

2011-01-06 Thread David Duncan
On Jan 6, 2011, at 1:17 PM, Jon Sigman wrote: > Okay, I'm thoroughly confused now. What exactly is this hash value? The > documentation just says its "an integer that can be used as a table address > in a > hash table structure." That doesn't mean much to me. I would recommend that you read

Re: Context in GCD source cancel handler?

2011-01-06 Thread Dave Zarzycki
Jonathon, Please don't use SIGPIPE. That's just a hack from the 1970s to make simple command line programs die when their input goes away. Instead, please call signal(SIGPIPE, SIG_IGN) right inside of main(). Thereafter, Unix APIs like read(), write(), etc will return -1 and errno will be equal

Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-06 Thread Sherm Pendley
On Thu, Jan 6, 2011 at 3:54 PM, Abhinav Tyagi wrote: > > Problem: Scanning the disc for media files. As the media files can be > present anywhere > in the disc, searching whole disc by enumerating the directory listings will > be very tedious > i guess (like combining ls and grep in the terminal).

Re: NSDictionary key types

2011-01-06 Thread Jon Sigman
On Jan 6, 2011, at 1:24 PM, David Duncan wrote: > The short of it is that its a value that allows you to quickly tell if >something is worth looking at more closely for equality. As a real world >example >a hash code is equivalent to saying "this object is short, this object is >tall" >witho

Re: Context in GCD source cancel handler?

2011-01-06 Thread Jonathon Kuo
Wonderful, will do! Thanks to all! On Jan 6, 2011, at 1:31 PM, Dave Zarzycki wrote: > Jonathon, > > Please don't use SIGPIPE. That's just a hack from the 1970s to make simple > command line programs die when their input goes away. Instead, please call > signal(SIGPIPE, SIG_IGN) right inside of

Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-06 Thread Gary L. Wade
If you want Cocoa, check out enumeration in NSFileManager; if you want C/C++, check out iteration in Files.h. On 01/06/2011 12:54 PM, "Abhinav Tyagi" wrote: >Hi All, > >Although this querry may seem simple to you but since i dont have any idea >about it, >i am clueless as how to approach. > >Pro

Re: NSDictionary key types

2011-01-06 Thread Stephen J. Butler
On Thu, Jan 6, 2011 at 3:17 PM, Jon Sigman wrote: > Do the following two objects have the same hash value, and if so, why do thay? > How is it assigned? > id myStr1 = @"8760"; > id myStr2 = @"8760"; Long Rambling: Note: if [myStr1 isEqual:myStr2] then [myStr1 hash] == [myStr2 hash]. That's part

Troubleshooting CFMessagePort

2011-01-06 Thread Jerry Krinock
I've been using CFMessagePort for interprocess communication for the last few weeks; made myself a couple little wrapper classes around CFMessagePortCreateLocal and CFMessagePortCreateRemote, implementing a "client" and "server". I create a server only when needed and destroy it when done. Typ

Re: How to get "colored" font smoothing in a CALayer

2011-01-06 Thread James Bucanek
David Duncan wrote (Thursday, January 6, 2011 11:53 AM -0800): On Jan 6, 2011, at 10:28 AM, James Bucanek wrote: So how can I get my text to draw as smoothly as the Finder? Subpixel antialiasing requires a background to antialias against, and your layer is pr

Re: How to get "colored" font smoothing in a CALayer

2011-01-06 Thread David Duncan
On Jan 6, 2011, at 2:51 PM, James Bucanek wrote: > David Duncan wrote (Thursday, January 6, 2011 > 11:53 AM -0800): > >> On Jan 6, 2011, at 10:28 AM, James Bucanek wrote: >> >>> So how can I get my text to draw as smoothly as the Finder? >> >> Subpixel antialias

Re: How to get "colored" font smoothing in a CALayer

2011-01-06 Thread James Bucanek
Kyle Sluder wrote (Thursday, January 6, 2011 12:06 PM -0800): On Thu, Jan 6, 2011 at 10:28 AM, James Bucanek wrote: Greetings, The is probably more of a Carbon question than a Cocoa question, but since the problem starts with CALayer, I'll start here first. W

Re: Troubleshooting CFMessagePort

2011-01-06 Thread Dave Keck
I don't see anything obviously wrong with your code after a cursory glance. I assume you're familiar with the bootstrap context issues mentioned in TN2083 and elsewhere? If you can post a complete example that exhibits the problem, I'd be happy to investigate further. However, consider using NSMac

Re: Troubleshooting CFMessagePort

2011-01-06 Thread Dave Keck
>> Is there any utility to maybe probe the Mach ports that my app has open?  I >> can't find anything like that. > > top(1) and Activity Monitor can list the number of ports a process has > open, but I'm not aware of any utilities that go into any more detail. Oh, `sudo launchctl bstree` might al

Re: Stupid png icons

2011-01-06 Thread BareFeetWare
On 07/01/2011, at 3:04 AM, Matt Neuburg wrote: > GraphicConverter doesn't really have the cojones to do what you need done. > You want something that can use e.g. the greyness of each pixel in the > original image to determine the greyness of each pixel in the alpha mask. > Photoshop or GIMP wi

NSDocument updateChangeCount when using Bindings

2011-01-06 Thread Kevin Bracey
After hours of searching I have to presume I'm doing something wrong or missing something obvious, as no one else has this simple problem:-) OS X 10.6.6 NSDocument Application. MyDocument has a iVar = NSMutableArray *allScenes; @property( retain ) NSMutableArray *allScenes; @synthesize allScene

Thumbs Lists

2011-01-06 Thread Fernando Aureliano
Hi! I'm doing my first app. Is a magazine, and I would like to show a list of covers. Someone can give-me a tip of how I can do this with a UIImageView or something like that? Thanks for the help! -- *Fernando* ___ Cocoa-dev mailing list (Cocoa-dev@

Re: NSDocument updateChangeCount when using Bindings

2011-01-06 Thread Markus Spoettl
On Jan 6, 2011, at 9:01 PM, Kevin Bracey wrote: > After hours of searching I have to presume I'm doing something wrong or > missing something obvious, as no one else has this simple problem:-) > OS X 10.6.6 NSDocument Application. > > MyDocument has a > iVar = NSMutableArray *allScenes; > @prop

Re: Thumbs Lists

2011-01-06 Thread Nick Zitzmann
On Jan 6, 2011, at 7:58 PM, Fernando Aureliano wrote: > I'm doing my first app. Is a magazine, and I would like to show a list of > covers. > > Someone can give-me a tip of how I can do this with a UIImageView or > something like that? Unfortunately there isn't any publicly available cover flow

Re: [SOLVED] Unresponsive CFMessagePort

2011-01-06 Thread Jerry Krinock
On 2011 Jan 06, at 17:33, Dave Keck wrote: > Oh, `sudo launchctl bstree` might also be useful. Thank you, Dave. It was useful. It told me that my server port was "active" (A). This confirms what the Client tells me, that the port is found, but times out when connecting to it. Odd, though,

Re: Thumbs Lists

2011-01-06 Thread BareFeetWare
On 07/01/2011, at 1:58 PM, Fernando Aureliano wrote: > I'm doing my first app. Is a magazine, and I would like to show a list of > covers. > > Someone can give-me a tip of how I can do this with a UIImageView or > something like that? It's hard to answer without know what you've got, but you s

Re: NSDocument updateChangeCount when using Bindings

2011-01-06 Thread Quincey Morris
On Jan 6, 2011, at 18:01, Kevin Bracey wrote: > MyDocument has a > iVar = NSMutableArray *allScenes; > @property( retain ) NSMutableArray *allScenes; > @synthesize allScenes; > > In my nib I have a ArrayController bound to allScenes and it is hooked up to > a Table and and selected Fields, it