Re: Desktop geometry problem

2012-06-08 Thread Gregory Weston
On Jun 8, 2012, at 02:20, Kyle Sluder wrote: > On Jun 7, 2012, at 7:30 PM, gweston wrote: > >> On Jun 07, 2012, at 10:22 PM, Graham Cox wrote: >> >> >> On 07/06/2012, at 9:23 PM, Gregory Weston wrote: >> >>> Does anyone know of existing c

Desktop geometry problem

2012-06-07 Thread Gregory Weston
Does anyone know of existing code or a trivial technique to get a CGPath or NSBezierPath that describes the shape of the desktop? I'll write and share it if it's not out there, but I'd rather not reinvent any wheels. My interests are: 1. It should be the actual perimeter of the desktop, not just

Re: First Responder

2012-05-10 Thread Gregory Weston
koko wrote: > I have a menu item connected to an action in First Responder; > > The action exists in an NSView subclass. > > The subclass implements acceptsFirstResonder and return YES. > > The subclass implements validateMenuItem and return YES; > > When the menu displays the menu item is dis

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare

2012-05-08 Thread Gregory Weston
Martin Wierschin wrote: >> If I understand Quincey correctly, that's exactly what he's saying: the >> semantics of localizedCaseInsensitiveCompare: might be such that it is not >> appropriate for such algorithms. > > As Jens mentioned, that doesn't make any sense. What good is a localized > co

Re: Stenography

2012-04-01 Thread Gregory Weston
deoxy t2 wrote: > I'm new to the list and new in Objective-C and Apple programming and I have a > very timely question, I want to manipulate images to develop stenography, but > do not know where begin. I'm reading:1.-vImage Programming Guide2 Core Image > Programming Guide > But it is not clea

Re: Can't delete file on device

2012-03-27 Thread Gregory Weston
Rick Mann wrote: > The file is generated and deleted by code; it's the same string passed > around, at least certainly in the existence check just before the attempted > delete. Surely that existence check would fail, too? Not necessarily. The problem with patterns like "check if transient reso

Re: makeObjectsPerformSelector on a sub class

2012-03-21 Thread Gregory Weston
Pascal Harris wrote: > Now I want to scramble the state of each of the tiles. In the game > controller, I'm using the following code: > > [[self.view subviews] makeObjectsPerformSelector:@selector(scrambleState)]; > > I've put a breakpoint in scrambleState - and it never gets called. I'm > gu

Re: Problem with refreshing NSMenuItems

2012-03-08 Thread Gregory Weston
Prime Coderama wrote: > I have an NSMenu with the following static NSMenuItems > > 1. NSMenuItem "Count of people" (hidden) > 2. NSMenuItem (hidden) > 3. NSMenuItem > 4. NSMenuItem "Refresh List" > 5. NSMenuItem > 6. NSMenuItem "Quit" > > I then dynamically add n-amount of NSMenuItems between

Was: issues using encodeWithCoder: with NSAttributedString for iOS

2012-02-27 Thread Gregory Weston
Jens Alfke wrote: > I don’t know of an easy workaround. Back in the day I would have suggested > creating a category on CGColor that adds the required archiving methods, but > doing this will get you rejected from the App Store. Wait, what? Where's that documented? I haven't tried submitting so

Re: Was: Re: NSStepper - useless?

2012-02-24 Thread Gregory Weston
William Squires wrote: > Why didn't they just make the NSStepper a custom view that draws two arrows, > and has two sent actions that you can connect? Or even a variation of > NSMatrix with two button cells that look like arrows. That would avoid the > problem entirely, and be more intuitive to

Re: Using #define a good way for String constants, like enums for NSIntegers?

2011-08-09 Thread Gregory Weston
Devraj Mukherjee wrote: > I am writing an API client for a REST service, parts of the REST API > returns fixed String values. E.g. status of an order. > > I want to represents these fixed responses as constants. I have > represented fixed numeric values using enums and used a typedef to > represe

Re: Deprecated methods usage

2011-08-03 Thread Gregory Weston
Vyacheslav Karamov wrote: > Could I use deprecated methods in my application? > I have to support OS X 10.4+ and for example need to obtain file > modification date, > so could I use [NSFileManager fileAttributesAtPath:traverseLink:] which > is deprecated in 10.5? Deprecation is your warning th

Re: Dialog Command Keys

2011-07-26 Thread Gregory Weston
Bill Appleton wrote: > Based on my app, the dialog boxes have to be created dynamically, so i can't > use Interface Builder, so they are assembled out of cocoa controls as > needed. > > My dialogs beep when i control-x to cut some selected text > > What is the simple way for my dialog window to

Re: iTunes 10.4 visualizers

2011-07-21 Thread Gregory Weston
Yesterday I wrote: > Please point me to another list if there's one more appropriate. > > Seems that my iTunes visualizer doesn't work in Lion. Works fine in iTunes > 10.4 under Snow Leopard. Under Lion 64-bit it of course completely fails to > load. If I start iTunes in 32-bit mode it doesn't

iTunes 10.4 visualizers

2011-07-21 Thread Gregory Weston
Please point me to another list if there's one more appropriate. Seems that my iTunes visualizer doesn't work in Lion. Works fine in iTunes 10.4 under Snow Leopard. Under Lion 64-bit it of course completely fails to load. If I start iTunes in 32-bit mode it doesn't complain or log anything but a

Re: [Q] Will the be any problem in implementing an NSArray method using fast enumeration?

2011-07-01 Thread Gregory Weston
Dave DeLong wrote: > You can just do: > > NSArray *objectsArray = [theArray valueForKey:key]; > > And it'll do pretty much the same thing (except that it'll call -valueForKey: > on each item in the array, and not objectForKey:. However, if the objects > are NSDictionaries, that's pretty much

Re: sorting a pair of arrays

2011-06-28 Thread Gregory Weston
Mikkel Islay wrote: > It sounds to me like one way of looking at your data structures is as a > NSDictionary with the first array as keys and the second as objects (values). Which fails the if there's any possibility that the items in the first array aren't unique. Better two have an array of d

Re: Proper removal of a NSStatusItem?

2011-06-22 Thread Gregory Weston
Mac QA wrote: > When my app quits it leave a gap on the Finder's menu bar where the > NSStatusItem was. This gap gets cleaned up the next time a user > "switches" apps. But if you quit my app, see the gap in the Finder > bar, then just leave the Finder as the frontmost app for awhile that > gap ju

Re: Getting mouse cursor position

2011-05-07 Thread Gregory Weston
On May 7, 2011, at 13:28, Nick wrote: > 2011/5/7 Gregory Weston : >> eveningnick wrote: >> >>> Hello >>> I am searching for the way to find a cursor's position on the screen. >>> >>> I tried to use method -hotSpot of NSCursor, but it ret

Re: Getting mouse cursor position

2011-05-06 Thread Gregory Weston
eveningnick wrote: > Hello > I am searching for the way to find a cursor's position on the screen. > > I tried to use method -hotSpot of NSCursor, but it returns >> sc x=-2057825613, y=0 > > > -(IBAction)timeHandler:(id)timer { >//NSCursor *sc = [NSCursor currentSystemCursor]; > N

Re: Stack of NSWindow sheets

2011-04-27 Thread Gregory Weston
On Apr 27, 2011, at 09:35, Oleg Andreev wrote: > I'll clarify what I meant. > > Normally, user will see only one sheet at a time. There won't be any sort of > step-by-step sheet switching within a single task (like in Xcode 4 when > creating a new file). The only issue I'm trying to solve is p

Re: Stack of NSWindow sheets

2011-04-27 Thread Gregory Weston
Oleg Andreev wrote: > Is there a well-known way (or a library) to keep a stack (or queue) of sheets > per window? > > I'm a developer of Gitbox - a git repository manager. It keeps several repos > opened and periodically updates them. If some repos require authentication, a > modal dialog pop

Re: Contextual menu commands in the Finder

2011-02-16 Thread Gregory Weston
David Catmull wrote: > So I gather that now that the new 64-bit Finder doesn't support the old CM > plugin API, the only way to add commands to the Finder's contextual menus is > with the services API. The problem I'm having with doing it as a service is > that the commands I want to add should

Re: UTI for ScreenSaver, Automator Actions and PreferencePanes?

2010-12-18 Thread Gregory Weston
Stephane Sudre wrote: > Which UTIs are supposed to be used for CFBundleDocumentTypes > > LSItemContentTypes for : In a terminal window, you can use mdls to show you for any given file. On this 10.6.5. machine, I get: > - Screen Savers Something dynamically generated > - Automator Actions com

Re: convert CFRange to NSRange?

2010-12-13 Thread Gregory Weston
On Dec 13, 2010, at 04:02, John Engelhart wrote: > So, to the original poster- it's sort of like "Why is the sky blue?" > There's actually a good answer, but it's unbelievably complex and > convoluted. "So you know where to stop mowing." ___ Cocoa-dev

Re: Third Party Material

2010-11-16 Thread Gregory Weston
Richard Somers wrote: > I just noticed that Apple's Keynote, Pages, and Numbers '08 > applications acknowledge the following material. > > Mike Ferris ˆ (MOKit) Portions Copyright © 1996-2002 Mike Ferris. All > Rights Reserved. > > Kurt Revis ˆ (SNDisclosableView/SNDisclosureButton) Copyrigh

Re: add a icon to window title bar ?

2010-11-16 Thread Gregory Weston
Rajendran P wrote: > Hi , > I am developing a non document based App. i need to add an icon to its main > window title bar before the title string , any input on how to implement it > would be help full Found something in the list archives from 2008. You can use: [[ standardWindowButton:NSW

Re: What is Mac's "custom" for an agent to display its GUI?

2010-11-16 Thread Gregory Weston
Conrad Shultz wrote: > On 11/16/10 5:27 PM, eveningnick eveningnick wrote: >> Hello! >> I have to write an application, that should run on the background. >> When the user needs, it should display some control panel. On Windows >> system i would have used System tray, and an icon there - when the

Re: [NSImage] Bug in System Preferences? [solved]

2010-10-26 Thread Gregory Weston
On Oct 26, 2010, at 16:29, Stephane Sudre wrote: > On Tue, Oct 26, 2010 at 4:14 AM, Gregory Weston wrote: >> Iceberg-Dev wrote: >> >>>> When working with NSBitmapImageRep, calling -bitmapData is a signal >>>> that you may be editing the data. It is not re

Re: [NSImage] Bug in System Preferences? [solved]

2010-10-26 Thread Gregory Weston
Iceberg-Dev wrote: >> When working with NSBitmapImageRep, calling -bitmapData is a signal >> that you may be editing the data. It is not repackaged until the >> bitmap is drawn, or somesuch. It's illegal to just stash a pointer >> to the data and use it arbitrarily later - that won't necessa

Re: confused about floats

2010-10-09 Thread Gregory Weston
Kyle Sluder wrote: > Just wanted to confirm that this is a repost of the previous thread? > > http://lists.apple.com/archives/cocoa-dev/2010/Oct/msg00117.html > > --Kyle Sluder > > On Tue, Oct 5, 2010 at 2:07 AM, Amy Heavey > wrote: >> ... It is. Notice that it came through on Oct 8, dated O

Re: Confused about floats

2010-10-05 Thread Gregory Weston
Amy Heavey wrote: > I've got two float values (x and y) that I'm using to change the > coordinates of a drawing action that is being looped through. I can > add a value to x and it draws the next image along, but I want to test > the value of x and if it is out of bounds I want to reset it t

Re: Why isn't this delegate protocol being seen?

2010-10-04 Thread Gregory Weston
G S wrote: >> No it's not. CLLocationManagerDelegate is defined in >> CLLocationManagerDelegate.h. CLLocationManager.h only includes a >> forward reference to the protocol. > > Aha, right-O. Thanks. I had just done a quick search and found the > string in there, and left it at that. I have a b

Re: Why is NSPopUp broken in drop-down mode?

2010-10-02 Thread Gregory Weston
Seth Willits wrote: > On Oct 1, 2010, at 12:06 PM, G S wrote: > >> Also, nothing >> indicates to the developer why the data-handling behavior of the >> control has changed simply because he chose an "up" or "down" style of >> opening. > > You're correct. A sentence or two in the documentation wo

Re: NSTimer memory management

2010-09-23 Thread Gregory Weston
slasktrattena...@gmail.com wrote: > Is this an over-release? > > timer = [ [NSTimer scheduledTimerWithTimeInterval: ...] retain]; > ... > [timer invalidate]; > [timer release]; Seems fine, although based on

Re: Cocoa-dev Digest, Vol 7, Issue 847

2010-08-20 Thread Gregory Weston
Bill Bumgarner wrote: > Preference panes are not designed to be embedded into applications other than > the System Preferences application. Even if you were to make it work (which > would require duplicating all of the internal functionality of the System > Preferences application), you are s

Re: Determining preferred localizations

2010-04-22 Thread Gregory Weston
On Apr 22, 2010, at 12:45 PM, Stephane Madrau wrote: > Le 22 avr. 2010 à 18:19, cocoa-dev-requ...@lists.apple.com a écrit : > >> Thanks, but no. What I'm passing in is the keys for the dictionary I get as >> a result of this code: >> >> io_connect_t thePort = CGDisplayIOServicePort(theScreenNum

Re: Determining preferred localizations

2010-04-22 Thread Gregory Weston
On Apr 22, 2010, at 7:50 AM, Rainer Brockerhoff wrote: > At 12:02 -0700 21/04/10, cocoa-dev-requ...@lists.apple.com wrote: >> From: Gregory Weston >> Date: Wed, 21 Apr 2010 09:59:48 -0400 >> Message-ID: >> >> I'm trying to display a localized

Re: Determining preferred localizations

2010-04-21 Thread Gregory Weston
Gary L. Wade wrote: >The list you are getting is a set of preferred localizations, so when trying >to get a resource from the first one, if not available, will go on to the >next one and so forth. > >You should utilize the localization-aware methods to handle getting >resources rather than trying

Determining preferred localizations

2010-04-21 Thread Gregory Weston
I'm trying to display a localized list of attached displays, and getting unexpected results in Carbon and Cocoa when attempting to determine the best localization. I did all the obvious-to-me Google searches without finding much except a couple of other people over the years having similar issue

Re: How do I get a file reference w/o relying on the path?

2010-04-04 Thread Gregory Weston
Ken Thomases wrote: > As of Snow Leopard, alias records are deprecated in favor of bookmark data, > but, again, it's probably overkill. (Both alias records and bookmark data > are more suitable if the reference is to be persisted for use by a later > process. Also, both can apply more robust

Re: Custom View in Toolbar

2010-03-09 Thread Gregory Weston
Paul Sanders wrote: > Gregory Weston wrote: > >> I just sat down and attempted to accomplish what you're describing. It took >> 15 minutes and well under a dozen lines of code. > > Care to share your code? As someone who develops on both Windows and Mac, I >

Re: Custom View in Toolbar

2010-03-08 Thread Gregory Weston
David Blanton wrote: > So, it is not the workman it is the tool. Proven by how long it took > Apple to include toolbar support in IB and the fact that there is not > one answer or example anywhere on how to do what is supposed to be > trivial. Ergo, I stand by may statement that a trivial t

Re: NSDocument "save as" bug

2010-02-01 Thread Gregory Weston
On Feb 1, 2010, at 12:16 PM, Half Activist wrote: > I'm not making any assumption on the number of documents that might exist at > one time. > Even if i have 10 documents opened, the one that i do a "save as" on has its > _instance method_ awakeFromNib called a second time: > The callstack show

Re: NSDocument "save as" bug

2010-02-01 Thread Gregory Weston
Half Activist wrote: > On Feb 1, 2010, at 8:54 AM, Alexey Zakhlestin wrote: > >> On 01.02.2010, at 10:13, Half Activist wrote: >> >>> Hello, >>> In a NSDocument based application, my document class handles 3 >>> different kinds of documents, 1 as a viewer and 2 as an editor. >>> Actuall

Re: Centering a window on the *current* screen, not the *main* screen

2010-01-26 Thread Gregory Weston
Oleg Krupnov wrote: > Anyway, it's an annoyance that the [NSWindow center] uses [NSScreen > mainScreen] instead of [NSWindow screen]. I'd consider it a bug of > AppKit, indeed. No, just a philosophical difference regarding the meaning and, more importantly, intent of "centering" a window. And it

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Gregory Weston
Andy Lee wrote: >> This works perfectly except for a single little problem. The title bar >> of the parent window and its "traffic light" window buttons are grayed >> our like if the parent window wasn't key window (which is true >> though). >> >> However, when a "natural" sheet is showing, the t

Re: Are views active or inactive?

2009-12-23 Thread Gregory Weston
On Dec 23, 2009, at 2:20 PM, Rick Mann wrote: > > On Dec 23, 2009, at 03:06:58, Gregory Weston wrote: > >> Did you happen to have an 'a-ha' moment when you typed that sentence? >> "Views" don't generally have an active/inactive state. Controls

Re: Are views active or inactive?

2009-12-23 Thread Gregory Weston
Rick Mann wrote: > On Dec 22, 2009, at 19:51:03, Kyle Sluder wrote: > >> On Tue, Dec 22, 2009 at 9:45 PM, Rick Mann wrote: >>> I'm listening for that notification. Sure is a clunky way to do things. >>> I've never used a view framework that didn't tell views when they became >>> active/inactiv

Re: Version number objects

2009-12-21 Thread Gregory Weston
Ken Tabb wrote: > I've got an app that needs to keep track of version numbers (eg. > "10.6.2") of things, and needs to be able to sort by these too. Is > there a class in Cocoa that handles this? To which Clark Cox replied: > NSString's -compare:options: already handles mixed > alphanumeric

Re: Drawing into myView

2009-12-17 Thread Gregory Weston
>I have a subclass of NSView and I want to draw into it after I retrieve an >Image in an NSImageView. > >I'm trying to set 2 instance variables in the drawRect block of code... > >@property(readwrite) NSRect tRect; >@property (retain, readwrite) NSGraphicsContext*savedContext; >___

Re: NSSlider's setAltIncrementValue: broken?

2009-12-03 Thread Gregory Weston
Sean McBride wrote: > The docs for NSSlider's setAltIncrementValue: say "Sets the amount by > which the receiver modifies its value when the knob is Option-dragged". > It does not. > > Anyone using this successfully? Didn't work for me when I tried it just now. Two interesting behaviors observe

Re: Problem on NSPopUpButton Class

2009-11-23 Thread Gregory Weston
charisse wrote: > Is there a known problem with subclassing an NSPopUpButton class in Snow > Leopard 10.6.2 ? > > Problem: subclassed popup button cannot be disabled sometimes. Working fine here just now. Has worked fine in the past. I'm going to go out on a limb and say there's probably some

Re: setToolTip: not working

2009-11-18 Thread Gregory Weston
Ben Haller wrote: >>> Given the deafening silence on this, I'm putting in a Radar on the >>> problem (7404209) and moving on. :-> >> >> Have you tried reproducing the problem with a test application? > > I get the impression that others are not seeing it because it's a > problem that spec

Re: NSFileManager thread safety?

2009-11-16 Thread Gregory Weston
David Cake wrote: > The following code snippet works fine from my main thread. >NSFileManager *tempFileManager = [[NSFileManager alloc] init]; >NSString *path= [self tempDirPath]; >if(![tempFileManager removeItemAtPath: path error: nil]) { >NSLog(@"failed to remov

Re: why use pow(x, 2)?

2009-11-02 Thread Gregory Weston
Luke the Hiesterman wrote: On Nov 2, 2009, at 11:25 AM, Ed Wynne wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster, so except for clarity reasons, there isn't a good reason to use pow() in that case. Would it really be that mu

Re: Should I try to avoid loading principal class of plug-in?

2009-10-11 Thread Gregory Weston
Rick Mann wrote: I'm working on a plug-in-based app. While I have to scan all of the plug-ins and load some information from their info.plists, I don't necessarily need to load any of the code until a plug-in is actually used. My main question is, is it worth it to do this? It seems like that's

Re: odd behavior with NSError?

2009-10-02 Thread Gregory Weston
Stephen J. Butler wrote: On Thu, Oct 1, 2009 at 10:31 PM, Colin Howarth wrote: NSStringEncoding *enc; NSError *error; NSString *file = [NSString stringWithContentsOfFile:@"/Users/colin/developer/Trace/glass.csv" usedEncoding:enc error:&error]; The way you pass "enc" is

Re: 10.6 specific crash

2009-10-01 Thread Gregory Weston
Duncan Champney wrote: An app our company is developing is showing odd behavior and crashes under 10.6, but not under 10.5. I've done some digging and figured out that a major contributor to the crash is the following routine: (I've changed it slightly to get rid of unimportant details and mak

Re: Setting BorderThickness moves resize widget?!?

2009-09-29 Thread Gregory Weston
Knut Lorenzen wrote: Dear List, please take a look at this image: (Picture shows my App in front of Safari before/after) I would like to have a Statusbar in my App and I am using [mainWindow setContentBorderThickness: 16.0 forEdge: NSMinYEdge];

Re: Frameworks in red

2009-09-27 Thread Gregory Weston
ERG Consultant wrote: I should have mentioned that the Frameworks in question are the System frameworks. And they are Found Fine by The original App. (which Runs just Fine.) Nevertheless, Graham has correctly stated the reason that items show up in red: Xcode can't find them where it thin

Re: Correct way to tell if a path is to a .bundle?

2009-09-25 Thread Gregory Weston
Rick Mann wrote: On Sep 25, 2009, at 17:15:45, Peter Ammon wrote: On Sep 24, 2009, at 8:09 PM, Jens Alfke wrote: On Sep 24, 2009, at 6:41 PM, Rick Mann wrote: I'm scanning a directory for plugins for my app. Given a path, what's the right way to tell if it's a path to a bundle? -[NSWorks

Re: IB does not show Outlet/Action section in inspector

2009-09-23 Thread Gregory Weston
Bill Cheeseman corrected/educated me: On Sep 23, 2009, at 7:11 AM, Gregory Weston wrote: There is no mechanism in the current version of the tools for defining outlets and actions in IB; only for assigning them. I don't believe this statement is true, if I understand your point corr

Re: IB does not show Outlet/Action section in inspector

2009-09-23 Thread Gregory Weston
Michael Süssner wrote: I have the problem with every object even the one from the examples (Apple). I have instantiated an NSObject from the IB Library and then I've tried to add an outlet. Still, no outlet section in the inspector (identity). Perhaps I'm misreading, but I suspect that Michae

Re: Mac Mini or iMac for Cocoa Development?

2009-09-14 Thread Gregory Weston
On Sep 14, 2009, at 9:39 AM, Graham Cox wrote: On 14/09/2009, at 11:29 PM, Gregory Weston wrote: Funny. To me that's actually an argument in the mini's favor. Or, more broadly, it's extremely important that you actually test, early, on something comparable to the

Re: Mac Mini or iMac for Cocoa Development?

2009-09-14 Thread Gregory Weston
Graham Cox wrote: I am leaning towards iMacs, because these computers will serve as ambassadors as well as development machines; I want to double-check that if we have to go to Mac Minis, say with 4 GB of RAM, we won't be waiting forever to compile a simple program. iMac will probably be a be

Re: AffineTransform

2009-09-12 Thread Gregory Weston
Development wrote: I am using the following to rotate an image and Im having a problem. After the transform when I attempt to move the image it collapses to 0 width and does other unpredictable and strange things. What am I forgetting to do so that the image is movable? self.transform =

Re: change in launch services binding behavior?

2009-09-03 Thread Gregory Weston
Matt Neuburg wrote: I wonder whether someone (preferably from Apple) could provide details on how Snow Leopard has changed its algorithm for how a document is bound to an application, esp. when double-clicking the doc in the Finder. I've done a little bit of experimenting on that a couple

Context menus into services

2009-09-03 Thread Gregory Weston
I know and agree with the rationale, but it's really looking like a premature move. I've got a context menu item that operates on general file system objects, but not on volumes and not on a couple of specific "special" folder types. In the process of converting to a service for 10.6, I'd c

How does launchAppWithBundleIdentifier work?

2009-09-03 Thread Gregory Weston
Specifically, I note that the documentation for the fourth parameter, the launch identifier, reads: "On input, a pointer to a number object variable. On return, the variable contains a number object with a unique identifier for the launch attempt. You can use this value to distinguish indiv

Re: contextual menu plugin example in cocoa

2009-09-01 Thread Gregory Weston
Klaus Wik wrote: Actually, now that services isn't one big bloated list that is always on, it is a sensible replacement. Mixed feelings. It makes a certain kind of sense, but we lose a few things that I've considered important: - Items that change title and effect when modifier keys are us

Re: Get size of folder

2009-08-19 Thread Gregory Weston
PCWiz wrote: I need a good method to find the size of a file or folder exactly as displayed in Finder. I've tried every method I could find on the internet, from using the du shell utility with NSTask to using the Carbon file manager. I need something that will work under heavy load (processing

Re: Allowing error-prone code line to persist in app

2009-08-18 Thread Gregory Weston
Chris Paveglio wrote: This is a question of style. My app has text fields to display a number, and with a command I format it like a phone number. So for the second phone number, sometime there is not a second phone (or fax). So my command to format the 2nd phone number logs an error to th

Re: "intelligent" flexible popup

2009-07-19 Thread Gregory Weston
Daniel Child wrote: As a follow-up to the previous question on popups in a table, I am wondering what APIs you can use to implement the kind of "intelligent" popups one finds, for example, when filling out the State field in forms needing an address. You start typing "Ma" and Maine or Maryland c

Re: User interface validation doesn't work, right?

2009-07-01 Thread Gregory Weston
Bill Cheeseman wrote: For years, the "Implementing Validation" section of Apple's "User Interface Validation" document has said the following: "Before it is displayed, a user interface item checks to see if its target implements validateUserInterfaceItem:. If it does, then the enabled status o

Re: External Drives Questions

2009-06-29 Thread Gregory Weston
Ammar Ibrahim wrote: How can I do the following in Cocoa: 1- Get the list of mounted drives? [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths] 2- Get the serial number of the mounted drive/disk Don't know about serial number, but for UUID you use the Disk Arbitration framework. Cre

Re: Service not working

2009-06-23 Thread Gregory Weston
Guillem Palou wrote: I'm trying to develop an application that acts as a service, but I cannot make it appear on the Services Menu and I cannot execute it on the applications. ... NSServices ... NSMenuItem

Re: SQLite -- same DB, different machines -> different results

2009-06-13 Thread Gregory Weston
On Jun 12, 2009, at 5:30 PM, Тимофей Даньшин wrote: On Jun 11, 2009, at 6:30 PM, Gregory Weston wrote: Timofey wrote: The application is a dictionary. As the user types a word into the searchfield, he/she gets a completion suggestion (much like in Xcode for class or variable or method

Re: SQLite -- same DB, different machines -> different results

2009-06-11 Thread Gregory Weston
Timofey wrote: I've written the alfa of my first app on the Mac which works in an acceptable manner on my macbook. But when i run it on my iMac, it returns different results for the in seemingly the same conditions. The application is a dictionary. As the user types a word into the searchfield,

Re: No Title Bar on NSPanel

2009-06-04 Thread Gregory Weston
John Ku wrote: Hello all! Is there a way to subclass NSPanel and turn off the title bar on it? I've check NSPanel and NSWindow. The only thing I found was setShowsToolbarButton in the 'Managing Title Bars' section which is not it. Im doing this for a pop up menu of a menu bar application. I

Re: Booleans

2009-05-28 Thread Gregory Weston
John Ku wrote: I am trying to set an object's boolean, everything works but I get a warning of 'pointer from integer without a cast'. *// Here is the Main Class:* [theObject setActivated: YES]; *// Here is the Object Class:* @property(readwrite, assign) BOOL *activated; @synthesize

Re: NSTableView, 2mln rows, looks bad.

2009-05-04 Thread Gregory Weston
Timofey wrote: I need to have a tableView with about 2 million rows, and that figure may actually be bigger. But the table looks awfully bad in that case: you get artifacts when scrolling, the text in the rows does not coincide with the alternate bluish and white stripes, and if you click on a r

Re: How to make app login window to look like OS X user login window ?

2009-04-23 Thread Gregory Weston
Chris Williams wrote: I would also argue that in general splash screens are an anachronism. They're a holdover from slow hard drives attached to slow CPUs and the idea that an app taking several seconds to finish preparing itself for user interaction was normal. Today there are relatively f

Re: How to make app login window to look like OS X user login window ?

2009-04-22 Thread Gregory Weston
Mario Ku?njer wrote: Greetings everyone ! So the question is how to make a window that doesn't have a title bar and borders ? Actually I would like it to be just like user login window of OS X. This could also go for a so called "Splash Screen" on app launch. Thanks to all in advance. This

Re: Notifications for the low battery...?

2009-04-21 Thread Gregory Weston
Anshul jain wrote: I am developing a small Application to perform a Task. Which can drain lot of battery(in Laptops). IOKit provides the APIs to get the battery status but i was not able to find the Notification which can notify the application when the battery is Low. So I w

Re: Daylight Savings Time

2009-04-15 Thread Gregory Weston
Greg Robertson wrote: Basically I would like to display records for a week duration but I am unsure how to handle daylight savings time. Is there a way to see if daylight savings time has or will occur? If you want to see whether a DST switch happens during a given interval, just subtract th

Re: static vs non-static. Recommendation needed.

2009-04-13 Thread Gregory Weston
ok5.admin wrote: Hello. A foreword: In my application I need to allow the user to create a database. So i display a dialogue panel, collect all the necessary information about the db to be created and create a "DatabaseInfo" object. Then i pass that DatabaseInfo object to the DatabaseCreator to

Re: Change view on resize

2009-04-10 Thread Gregory Weston
Andy Lee wrote: On a side note: I notice the Basic/Scientific/Programmer menu items are not in the nib, so they must be generated programmatically at startup. I also can't find the views for these three modes in the nib, so either I'm missing something or they are generated programmatically, wh

Re: Very interesting ordering caveat with NSArray arrayWithObjects:

2009-04-04 Thread Gregory Weston
Eric Hermanson wrote: Some (or most) people might be aware of this caveat, but I was not, so I'll share it. Consider this code: NSArray *array = [NSArray arrayWithObjects:[MyCounterClass newObject], [MyCounterClass newObject], nil]; where [MyCounterClass newObject] is a static method that

Re: Comparing path strings

2009-03-27 Thread Gregory Weston
On Mar 26, 2009, at 10:39 PM, Adam R. Maxwell wrote: On Mar 26, 2009, at 7:14 PM, Gregory Weston wrote: Jean-Daniel Dupas wrote: An other way may be to convert them into FSRef (using FSPathMakeRef()) and then compare them using FSCompareFSRefs() There's a risk to that solution, t

Re: Comparing path strings

2009-03-26 Thread Gregory Weston
Jean-Daniel Dupas wrote: Le 26 mars 09 à 13:22, Jerry Krinock a écrit : On 2009 Mar 26, at 01:04, Oleg Krupnov wrote: Am I missing a method specifically intended for path comparison? Not that I know of. But you are missing the method for preprocessing them before comparison. Look at:

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Gregory Weston
On Feb 21, 2009, at 3:15 PM, Kevin Walzer wrote: Gregory Weston wrote: To which I reiterate my prior comment: For more than a year now, Apple has been recommending the use of installer packages for all deployments. Apple is recommending installer packages instead of drag-and-drop

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Gregory Weston
Alex Kac wrote: That may be true - but many people would be overjoyed if an app would offer to install itself into an appropriate place. Sometimes people are cluttered because they don't have someone to help. If an app offered to help - just once - I don't see that as an intrusion, but a more Ma

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-18 Thread Gregory Weston
Ben Lachman wrote: I'm wanting to move away from DMGs to ZIP delivery. As part of this move I'd like to have my app, SousChef, prompt the user on first run to move itself to /Applications (or ~/Applications as appropriate). In a short search I can't find any code examples hanging about to do so

Re: Images In Dock Menu?

2009-02-13 Thread Gregory Weston
Chunk 1978 wrote: i have a NSMenu that i use as both a right-click menu and the dock menu. The images i use for some of the menu items will appear in the right-click menu, but they do not show up in the dock menu. i've connected the the File's Owner dockMenu to the NSMenu in IB so to add the m

Re: Paste with no Edit Menu

2009-02-11 Thread Gregory Weston
Andy Bell wrote: I am working on a project which is an Agent and just has a couple on Windows and a menu bar icon. The menu bar icon has a menu which is used to call up the two windows. Now I want to add 'Command-V' so that I can paste into the NSTextFields in this window, as I don't have

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Gregory Weston
Shawn Erickson wrote: On Wed, Feb 4, 2009 at 6:05 PM, Josh de Lioncourt wrote: Hi, I have some products under development written in C++. I am not using Cocoa for the most part, as these are cross-platform projects. Review... http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Lo

Re: Plain Text UTI Madness

2009-01-29 Thread Gregory Weston
Sean McBride wrote: I have a file without an extension, which in Finder is shown as "Plain text", has kMDItemKind = "Plain text", and yet kMDItemContentType is "public.data" -- what gives? Why is it a plain text "kind" of file, but not public.plain-text? Does this extension-less file have a

Re: Not Resolving Aliases

2009-01-27 Thread Gregory Weston
Scott Ribe wrote: I have given up on NSWorkspace, LaunchServices and now send the path via Distributed Objects. Hey, that surprises me ;-) Give what you said, my next attempt would have been constructing an open Apple Event... (Don't know if it would work, because I don't know when the norm

Re: Disabled button looks like enabled

2009-01-12 Thread Gregory Weston
Donnie Lee wrote: Imagine how the thread might have gone if you had put this information in your original e-mail: No, Michael, that was a simple technical question. ... The problem is, that when you go to people more experienced than you are to ask a "simple technical question" and peopl

  1   2   >