Re: OO idiom avoiding switch and if

2009-04-10 Thread Greg Guerin
Jeffrey Oleander wrote: Advice on what's least messy overall or pointers to sources of info would be appreciated. http://en.wikipedia.org/wiki/Finite_state_machine http://en.wikipedia.org/wiki/Reflection_(computer_science) Convert a string matching the symbolic name of a class or function

Re: Undocumented flags in LSCopyItemInfoForRef

2009-04-10 Thread Jean-Daniel Dupas
Le 10 avr. 09 à 07:06, Gerriet M. Denkmann a écrit : LSItemInfoFlags, returned by LSCopyItemInfoForRef() when the queried item is an application, contains several undocumented flags (i.e. flags which are NOT documented in LSInfo.h nor in the Launch Services Reference). E.g. iTunes.app

Re: Change view on resize

2009-04-10 Thread Andy Lee
On Apr 10, 2009, at 12:31 AM, Kyle Sluder wrote: On Thu, Apr 9, 2009 at 6:52 PM, Dave Keck davek...@gmail.com wrote: To satisfy both these requirements, I would first disable window resizing for your window in IB. Then, somewhere in your app's initialization code, do a little something like

Re: Change view on resize

2009-04-10 Thread Dave Keck
Wow, look at that. -setShowsResizeIndicator:. And it's been there since 10.0, dunno how I missed it. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: Change view on resize

2009-04-10 Thread Andy Lee
On Apr 9, 2009, at 6:52 PM, Dave Keck wrote: NSButton *zoomButton = [window standardWindowButton: NSWindowZoomButton]; [zoomButton setEnabled: YES]; [zoomButton setTarget: self]; [zoomButton setAction: @selector(doFancyThings:)]; Then, when your window's zoom button is clicked,

Re: Change view on resize

2009-04-10 Thread Andy Lee
On Apr 10, 2009, at 3:30 AM, Dave Keck wrote: Wow, look at that. -setShowsResizeIndicator:. And it's been there since 10.0, dunno how I missed it. I scanned the list of NSWindow methods myself and didn't see it even though it was right there. I only found it after I'd poked around with IB

Re: Change view on resize

2009-04-10 Thread Andy Lee
On Apr 10, 2009, at 3:36 AM, Andy Lee wrote: which finally led me to a post by Aki Inoue. I mean Ali Ozer. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: Undocumented flags in LSCopyItemInfoForRef

2009-04-10 Thread Gerriet M. Denkmann
On 10 Apr 2009, at 14:10, Jean-Daniel Dupas wrote: Le 10 avr. 09 à 07:06, Gerriet M. Denkmann a écrit : LSItemInfoFlags, returned by LSCopyItemInfoForRef() when the queried item is an application, contains several undocumented flags (i.e. flags which are NOT documented in LSInfo.h nor in

NSSegmentControl Image Scaling Problem

2009-04-10 Thread Peter Zegelin
I have an NSSegmentControl that is customizable by the user. They can add, delete, rename and set an image for a segment. The control is set up with a single segment in IB. Unfortunately when I add an image (via an NSImageView) only the first segment shows the image scaled correctly. If I

Re: NSSegmentControl Image Scaling Problem

2009-04-10 Thread Dave Keck
You probably need to set the image scaling on the segments added at runtime. Use NSSegmentedControl's -setImageScaling: forSegment:. The values you can use are listed in NSCell.h: NSImageScaleProportionallyDown = 0, // Scale image down if it is too large for destination. Preserve aspect

Re: NSSegmentControl Image Scaling Problem

2009-04-10 Thread Peter Zegelin
Ah yes thank you. Works great. Peter On 10/04/2009, at 7:16 PM, Dave Keck wrote: You probably need to set the image scaling on the segments added at runtime. Use NSSegmentedControl's -setImageScaling: forSegment:. The values you can use are listed in NSCell.h:

best way to skin a QTMovie Player

2009-04-10 Thread Memo Akten
Hi All, I would like to create a custom QTMoviePlayer. I've read the QTKit programming guide and looked at the sample, and understand the basics of using QTMovie and QTMovieView. I want a custom skin (play/ pause button, seekable controller etc.) I could do this just by using a QTMovieView

Re: Reversing OS X Menu Bar and Menus for True RTL Language Applications

2009-04-10 Thread Andrew Farmer
On 09 Apr 09, at 13:51, Dalmazio Brisinda wrote: I was wondering if anyone is aware of any work related to reversing the OS X menu bar and menus for true right-to-left language applications? By true RTL I mean coupling language localization with actually flipping the entire menu bar so

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,

Re: Change view on resize

2009-04-10 Thread Graham Cox
On 10/04/2009, at 9:32 PM, Gregory Weston wrote: To the OP: Please put a *lot* of thought into whether you really need to do this. Despite the fact that a couple of Apple applications deviate from the semantics of the zoom button it's extremely non-standard behavior. Even if you do it

Re: Change view on resize

2009-04-10 Thread Andy Lee
On Apr 10, 2009, at 7:32 AM, Gregory Weston wrote: 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

substring (or) CDATA XML PARSING?!

2009-04-10 Thread developers mac
Hi there, I went through the various substring methods like NSString *str1 = [theResponseString substringFromIndex:2] NSString *pathTrimmed = [theResponseString lastPathComponent]; and also other methods from:

Re: substring (or) CDATA XML PARSING?!

2009-04-10 Thread david paeme
how about using some of the NSXML components? check http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/index.html On 10 Apr 2009, at 14:31, developers mac wrote: Hi there, I went through the various substring methods like NSString *str1 = [theResponseString

Re: substring (or) CDATA XML PARSING?!

2009-04-10 Thread Filip van der Meeren
Hello, Just use NSScanner (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSScanner_Class/Reference/Reference.html ) to parse those html tags. Something like this should do the job: NSString *stringBeforeHtml = nil; NSScanner *scanner = [[NSScanner alloc]

Re: substring (or) CDATA XML PARSING?!

2009-04-10 Thread developers mac
Thanks for the response david. I am already paring the xml using NSXML parser alone. but My problem is, the CDATA is not present inside a node. I can get id name values by reading the node using XML parser. Is there any other way? ___ Cocoa-dev mailing

Re: substring (or) CDATA XML PARSING?!

2009-04-10 Thread Filip van der Meeren
Do not forget to release my scanner after using it... On 10 Apr 2009, at 14:44, Filip van der Meeren wrote: Hello, Just use NSScanner (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSScanner_Class/Reference/Reference.html ) to parse those html tags. Something

Re: Creating a Remote database connection.

2009-04-10 Thread Scott Ribe
You'll have to find a driver on your own. Good luck. I've been quite pleased in the past with OpenLink drivers. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list

Re: substring (or) CDATA XML PARSING?!

2009-04-10 Thread Drew Lawson
According to developers mac: Thanks for the response david. I am already paring the xml using NSXML parser alone. but My problem is, the CDATA is not present inside a node. I can get id name values by reading the node using XML parser. Is there any other way? The CDATA will be a text node.

Re: Change view on resize

2009-04-10 Thread Rainer Brockerhoff
At 05:46 -0700 10/04/09, cocoa-dev-requ...@lists.apple.com wrote: From: Graham Cox graham@bigpond.com References: 20090410073454.0145819aa2...@lists.apple.com 8bc5d931-c976-4670-987e-90da25217...@mac.com In-Reply-To: 8bc5d931-c976-4670-987e-90da25217...@mac.com Date: Fri, 10 Apr 2009

Value Transformer Name

2009-04-10 Thread Richard Somers
In an Xcode data model window, a transformable attribute has an input labeled Value Transformer Name:. The Core Data Programming Guide says By default, Core Data uses the NSKeyedUnarchiveFromDataTransformerName transformer, however you can specify your own transformer if you want. In my

Re: Setting Min, MAx and range of characters for NSTextField

2009-04-10 Thread Preston Jackson
Kyle, Thanks for getting back to me about this! I really appreciate your help! So, I do know that I should bind through a controller, but to pare down the example to the simplest case, I omitted it. My test application is very similar to yours. In fact, I even changed it to do uppercase

Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...

2009-04-10 Thread Michael Ash
On Fri, Apr 10, 2009 at 3:54 AM, david paeme dvdpm.co...@gmail.com wrote: On 10 Apr 2009, at 02:21, Greg Guerin wrote: david paeme wrote: instead of a string (%@) the %@ is the code for the -description of an object.  Strictly speaking, that isn't merely a string, but the result of

Re: best way to skin a QTMovie Player

2009-04-10 Thread Michael Ash
On Fri, Apr 10, 2009 at 7:11 AM, Memo Akten m...@memo.tv wrote: Hi All, I would like to create a custom QTMoviePlayer. I've read the QTKit programming guide and looked at the sample, and understand the basics of using QTMovie and QTMovieView. I want a custom skin (play/pause button, seekable

Re: Value Transformer Name

2009-04-10 Thread Richard Somers
On Apr 10, 2009, at 9:07AM, Keary Suska wrote: Who cares otherwise? I am just a poor ignorant programmer trying to come to grips with non- standard persistent attributes (C Structs) in Core Data. The lack of a sample code application which illustrates this makes life even more difficult.

NSLocalizedStringFromTableInBundle Questions

2009-04-10 Thread Todd Fantz
Hello, I am trying to do some localization in a plugin... and apparently you can't use NSLocalizedString in a plugin... so I am trying to use NSLocalizedStringFromTableInBundle NSString *NSLocalizedStringFromTableInBundle(NSString *key, NSString *tableName, NSBundle *bundle, NSString

WebKit Caching

2009-04-10 Thread Adam Thorsen
I would like to prevent a WebKit WebView from caching certain content. I've attempted to prevent this using several approaches, including: 1. Overriding the NSURLCache cachedResponseForRequest and cachedResponse forRequest methods 2. Handling -(NSURLRequest *)webView:(WebView *)sender

Re: Value Transformer Name

2009-04-10 Thread Richard Somers
On Apr 10, 2009, at 10:41AM, Quincey Morris wrote: However, the NSKeyedUnarchiveFromDataTransformerName transformer transforms an instance of NSData to an instance of whatever was archived in it. So, the default transformer goes *from* NSData. Custom transformers go *to* NSData. So,

Re: WebKit Caching

2009-04-10 Thread Jeff Johnson
Adam, I think that -[WebPreferences setUsesPageCache:] should work. - [WebPreferences setPrivateBrowsingEnabled:] will also have this effect, though it may be more than you want. -Jeff On Apr 10, 2009, at 11:27 AM, Adam Thorsen wrote: I would like to prevent a WebKit WebView from

Re: best way to skin a QTMovie Player

2009-04-10 Thread douglas welton
Memo, Is there a problem with building a normal skin for your movie (via: http://www.apple.com/quicktime/tutorials/mediaskins.html) and then playing it back in a controller-less QTMovieView? curiously, douglas On Apr 10, 2009, at 7:11 AM, Memo Akten wrote: Hi All, I would like to create a

Changing CAConstraint for a CALayer

2009-04-10 Thread Rama Krishna
I am using CALayoutManager for laying out Core Animation layers and it works great. Now I have a requirement that I need to modify the layout of the sub layers based on certain event. What this means is that the layout constraints specified by CAConstraint of the sublayers need to be modified.

Re: best way to skin a QTMovie Player

2009-04-10 Thread Memo Akten
Hi Douglas, that looks interesting, using that system can you customize the seek bar and seek handle? play/pause buttons? and also load any quicktime movie and play through that skin? Or is it just an overlay embedded in a movie? On 10 Apr 2009, at 18:06, douglas welton wrote: Memo, Is

Re: NSLocalizedStringFromTableInBundle Questions

2009-04-10 Thread Benjamin Stiglitz
If I do a NSBundle *thisBundle = [NSBundle bundleForClass:[self class]]; it won't compile. That code should work. Can you be more specific about the error? E.g. your exact code and compiler error logs. -Ben ___ Cocoa-dev mailing list

Re: WebKit Caching

2009-04-10 Thread Adam Thorsen
Jeff, Thanks for the response. These techniques do not appear to affect how WebKit caches javascript resources. This is what I tried: WebPreferences *prefs = [webView preferences]; [prefs setUsesPageCache:NO]; and WebPreferences *prefs = [webView preferences]; [prefs

Re: WebKit Caching

2009-04-10 Thread Jeff Johnson
If that's true, it sounds like a WebKit bug. Do you have a test case? Also, just noticing the mailing list we're on. WebKit developers and others familiar with WebKit development tend to hang out on the webkitsdk-dev list, so you might have better luck with your question there. -Jeff

Re: best way to skin a QTMovie Player

2009-04-10 Thread douglas welton
Memo, The short answer is yes... however, the details of how you do this are not my forte. You might be better served querying the QuickTime- Users List for more hands-on experience. You my also want to get familiar with the concept of a wired movie, which is covered in the QuickTime

Re: Value Transformer Name

2009-04-10 Thread Richard Somers
On Apr 10, 2009, at 11:54AM, Quincey Morris wrote: Core Data runs a custom transformer in the forward direction, but it runs the default transformer in the reverse direction. The documentation states Core Data uses an instance of NSValueTransformer to convert the attribute to and from an

Re: Changing CAConstraint for a CALayer

2009-04-10 Thread Filip van der Meeren
You could always call an invalidateLayer or layoutSubLayers... On 10 Apr 2009, at 19:15, Rama Krishna wrote: I am using CALayoutManager for laying out Core Animation layers and it works great. Now I have a requirement that I need to modify the layout of the sub layers based on certain

Re: NSLocalizedStringFromTableInBundle Questions

2009-04-10 Thread Dave Keck
If I do a NSBundle *thisBundle = [NSBundle bundleForClass:[self class]];  it won't compile. I'm going to go out on a limb and say you're using the above line in a plain-C function rather than an Objective-C class. Is this correct? 'self' is meaningless/undefined outside of the Objective-C

Screen Savers

2009-04-10 Thread Development
I'm writing a screen saver that needs to load a resource from it's own bundle path. However [[NSBundle mainBundle] resourcePath] of course loads only from the system preferences bundle. So, how can I load a resource from the screensaver's resource path?

Re: Screen Savers

2009-04-10 Thread Dave Keck
To get the path to a bundle that's loaded inside an arbitrary process, I create a stub subclass of NSObject (let's call it MyStubClass) and simply call [NSBundle bundleForClass: [MyStubClass class]]; This technique is the most straightforward way I know of to accomplish what you're looking for -

Re: Screen Savers

2009-04-10 Thread Douglas Davidson
On Apr 10, 2009, at 11:46 AM, Dave Keck wrote: To get the path to a bundle that's loaded inside an arbitrary process, I create a stub subclass of NSObject (let's call it MyStubClass) and simply call [NSBundle bundleForClass: [MyStubClass class]]; +bundleWithIdentifier: is also available if

Re: Screen Savers

2009-04-10 Thread Dave Keck
+bundleWithIdentifier: is also available if there's no obviously suitable class to use with +bundleForClass:. ... and according to the docs: +bundleWithIdentifier: This method is typically used by frameworks and plug-ins to locate their own bundle at runtime. This method may be somewhat more

Re: Value Transformer Name

2009-04-10 Thread Quincey Morris
On Apr 10, 2009, at 11:27, Richard Somers wrote: On Apr 10, 2009, at 11:54AM, Quincey Morris wrote: Core Data runs a custom transformer in the forward direction, but it runs the default transformer in the reverse direction. The documentation states Core Data uses an instance of

Re: WebKit Caching

2009-04-10 Thread Adam Thorsen
Jeff, The test case is this: Create an html page that requires a javascript file. Ensure that the javascript file has not been modified for at least an hour. Load a page that includes a javascript file into a webview. Now change the javascript file and reload the contents of the webview.

Re: Screen Savers

2009-04-10 Thread Development
Ty for the information :) On Apr 10, 2009, at 11:37 AM, Development wrote: I'm writing a screen saver that needs to load a resource from it's own bundle path. However [[NSBundle mainBundle] resourcePath] of course loads only from the system preferences bundle. So, how can I load a

Re: WebKit Caching

2009-04-10 Thread Greg Guerin
Adam Thorsen wrote: Load a page that includes a javascript file into a webview. Now change the javascript file and reload the contents of the webview. Any changes made to the javascript file will not be evident. Basic questions: Is the client performing a conditional GET request? Is the

NSPredicateEditorTemplateRow , pop up with Core Data objects

2009-04-10 Thread Dan Waltin
Hi, I'm trying to create a NSPredicateEditorTemplateRow where the last view is a popup, containing every item of a particular CoreData entity (named StudyVisit). In a previous mail to this list (Oct 16, 2008) I saw a tip that one could have an IBOutlet link to an NSArrayController, which

[MEET] Chicago CocoaHeads / CAWUG Tuesday 4/14

2009-04-10 Thread Bob Frank
The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group is holding our next meeting Tuesday, April 14th, at 7:00 PM at the Apple Store on Michigan Ave. Agenda: - Dave Dribin's Version Control Shootout - adjournment to O'Toole's When:

Re: Screen Savers

2009-04-10 Thread Nicko van Someren
On 10 Apr 2009, at 12:46, Dave Keck wrote: To get the path to a bundle that's loaded inside an arbitrary process, I create a stub subclass of NSObject (let's call it MyStubClass) and simply call [NSBundle bundleForClass: [MyStubClass class]]; This technique is the most straightforward way I

Re: find out where is a key equivalent assigned

2009-04-10 Thread Georg Seifert
I do not have spaces turned on. And if I open a fresh project is workes. Georg I have a old project with a big nib file and it seems that somewhere is a key equivalent defined for ctrl+left cursor key. If I press ctrl+left cursor key nothing happend (option+left and everything else works

Re: find out where is a key equivalent assigned

2009-04-10 Thread Greg Guerin
Georg Seifert wrote: I have a old project with a big nib file and it seems that somewhere is a key equivalent defined for ctrl+left cursor key. If I press ctrl+left cursor key nothing happend (option+left and everything else works fine). Do you want to know what element has the

Rendering OpenGL in timed loop (CoreVideo).

2009-04-10 Thread Brian Bruinewoud
All, I'm trying to run an OpenGL animation. At first I tried an NSTimer, but couldn't get the output to appear unless I resized the window. It was as if the redraw caused by NSTimer wasn't swapping buffers or whatever whereas the redraw caused by resize was. Note, however, that the

Re: Rendering OpenGL in timed loop (CoreVideo).

2009-04-10 Thread Greg Parker
On Apr 10, 2009, at 6:15 PM, Brian Bruinewoud wrote: However, if I place any openGL code (even just glGetError) in the // Add your drawing code here location, the program crashes (NSLog calls work fine). Note that the openGL code isn't called until after applicationDidFinishLaunching so its

Re: Rendering OpenGL in timed loop (CoreVideo).

2009-04-10 Thread Brian Bruinewoud
Oh. Well, the other two threads don't look particularly crashed, either: Thread 2: #0 0x92b5f3ae in __semwait_signal #1 0x92b8a326 in _pthread_cond_wait #2 0x92b89d0d in pthread_cond_wait$UNIX2003 #3 0x94909b32 in glvmDoWork #4 0x92b89095 in _pthread_start #5

Re: Rendering OpenGL in timed loop (CoreVideo).

2009-04-10 Thread Brian Bruinewoud
Note that this thread is stopping on the line: GLint e = glGetError(); And that getFrameForTime looks like this: - (CVReturn)getFrameForTime:(const CVTimeStamp*)outputTime { NSLog( @getFrameForTime ); if( !shouldRun ) return kCVReturnError; redcomp = redcomp + 0.01;

Re: Screen Savers

2009-04-10 Thread Michael Ash
On Fri, Apr 10, 2009 at 5:49 PM, Nicko van Someren ni...@nicko.org wrote: On 10 Apr 2009, at 12:46, Dave Keck wrote: To get the path to a bundle that's loaded inside an arbitrary process, I create a stub subclass of NSObject (let's call it MyStubClass) and simply call [NSBundle

Re: Rendering OpenGL in timed loop (CoreVideo).

2009-04-10 Thread Michael Ash
On Fri, Apr 10, 2009 at 9:56 PM, Brian Bruinewoud br...@darknova.com wrote: Note that this thread is stopping on the line:        GLint e = glGetError(); And that getFrameForTime looks like this: - (CVReturn)getFrameForTime:(const CVTimeStamp*)outputTime {    NSLog( @getFrameForTime );