Mixing ObjC and C++ STL on same ObjC source file

2008-09-12 Thread Daniel Luis dos Santos
Hello ! I have an objective C class and want to call a method on a class in C+ +. As argument to the C++ class is a map instance of the STL. The ObjC class definition is on a file with a mm extension. I have std::map *var as a member variable of the ObjC class. When I compile the code there

Re: Mixing ObjC and C++ STL on same ObjC source file

2008-09-12 Thread matt . gough
On 12 Sep 2008, at 10:17, Daniel Luis dos Santos wrote: Hello ! I have an objective C class and want to call a method on a class in C ++. As argument to the C++ class is a map instance of the STL. The ObjC class definition is on a file with a mm extension. I have std::map *var as a member

Re: Link aganist sem.h

2008-09-12 Thread Peter O'Gorman
dexter morgan wrote: I've made as you suggested but nothing is changed. Take a look here: http://img440.imageshack.us/img440/103/picture1it4.png thanks a lot typo, change semclt to semctl in main. Peter -- Peter O'Gorman http://pogma.com ___

Re: Mixing ObjC and C++ STL on same ObjC source file

2008-09-12 Thread Dave Carrigan
On Sep 12, 2008, at 1:17 AM, Daniel Luis dos Santos wrote: I have std::map *var as a member variable of the ObjC class. Is this really how it's declared? std::map is a template, so you have to do something like: std::maptype1,type2* var; Or better yet: typedef std::maptype1,type2

Re: Core Data Migration Progress

2008-09-12 Thread Doug Penny
On Thu, Sep 11, 2008 at 8:02 PM, Adam Swift [EMAIL PROTECTED] wrote: No, you'll need to do a manual migration so you can register yourself as an observer of the NSMigrationManager's migrationProgress Thanks Adam, I figured that was the case. I didn't want to spend much time on this feature so

Re: NSXMLParser bug?

2008-09-12 Thread Michael Ash
On Fri, Sep 12, 2008 at 6:55 AM, Graham Cox [EMAIL PROTECTED] wrote: By the way, the operative word with my comment regarding NSView was effective. I can see that init can just pass a zero rect, but does that make a useful view? No, not really - but perhaps I miss the point a bit there. The

Re: clearing NSView outside of drawRect:

2008-09-12 Thread Chinh Nguyen
On Sep 11, 2008, at 10:16 PM, Ken Ferry wrote: If I read this correctly, you're hoping that you can erase some of the drawing done in your overlay view, just revealing the original drawing in your complex background view. You can get the effect you want in layer backed mode (c.f. -[NSView

Question about dataWithPDFInsideRect:

2008-09-12 Thread Chris Goedde
Hi all, Suppose I have a model (myModel) and its view (myModelView) which is a subclass of NSView. myModel has an update method that updates the model, and changes in the view are all drawn inside the drawRect: method of myModelView. If I have the following sequence: [ myModel update ];

NSBezierPath lineToPoint: Rate

2008-09-12 Thread Ian was here
I have an app that uses a pen tool. If I move the mouse slowly, the free-hand drawing looks smooth, but as I increase the speed at which I move the mouse, the line gets bumpy. I am calling lineToPoint: in the mouseDragged: method of my view. Has anyone found a solution to this problem.

Re: Question about dataWithPDFInsideRect:

2008-09-12 Thread Benjamin Stiglitz
Suppose I have a model (myModel) and its view (myModelView) which is a subclass of NSView. myModel has an update method that updates the model, and changes in the view are all drawn inside the drawRect: method of myModelView. If I have the following sequence: [ myModel update ]; [

Two Dimensional Array

2008-09-12 Thread Jordon Hirshon
I'm new to Objective-C. Can someone suggest an approach to building a two dimensional array of integers? Thanks, Jordon ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Using NSAlert with PyObjc - basics

2008-09-12 Thread Tobias Prinz
Hello there, I am trying to display a little pop-up using NSAlert. I've used a fairly standard snippet from this page (which is written in German, plus it is ObjC code): http://cocoa-coding.de/nsalert/nsalert.html My translation to Python is the following. Yes, that's step-by-step

NSArrayController's canRemove controllerkey and toolbar items problem

2008-09-12 Thread Sacha
Hi, I ran into a problem where the canRemove controllerkey doesn't correctly disables a toolbar item. What I first had, was a simple toolbar item, who's enabled property was bound to the canRemove controllerkey of an arraycontroller in my nib, and that sent an action to the same arraycontroller

RE: NSXMLParser bug?

2008-09-12 Thread Karan, Cem (Civ, ARL/CISD)
SNIP This is the usual pattern at init. Let's say a user calls a non-designated initializer. That may call other non-designated initializers, but at some point one of those will call self with something that is a designated init method of the leaf class. That method will call

Re: Two Dimensional Array

2008-09-12 Thread Shawn Erickson
On Fri, Sep 12, 2008 at 5:05 AM, Jordon Hirshon [EMAIL PROTECTED] wrote: I'm new to Objective-C. Can someone suggest an approach to building a two dimensional array of integers? Objective-C is a super set of C and you question appears to be more of a C question. In other words you would do

Re: Two Dimensional Array

2008-09-12 Thread Jamie Hardt
2 ways- * Identically to C: int myArray[X_SIZE][Y_SIZE]; This will perform much faster but will have all of the drawbacks of a dumb C array. * Or with NSArray/NSMutableArray: NSMutableArray *myArray = [NSMutableArray arrayWithObjects: [NSMutableArray array],[NSMutableArray array],nil];

Re: Animate a CGPath

2008-09-12 Thread David Duncan
On Sep 11, 2008, at 12:21 PM, Daniel Weber wrote: Hi everyone. I have an NSView with some appkit drawing code that I'm trying to convert to core graphics drawing code. One thing I'm having trouble with is the transition from NSBezierPath to CGPath. Basically in my application, I want to

Programmatically dismiss NSPopUpButton menu

2008-09-12 Thread Jeff Johnson
I have a NSView that only appears in a window when a certain activity is in progress, and there's an NSPopUpButton in the view that acts as a gear menu with actions that relate to the activity in progress. The issue is that if the button's menu is still open when activity finishes and the

Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Brad Gibbs
I'm working on an application with a single main window and a number of views and view controllers. I have a navigation window that pops up and allows users to set preferences and also switch views in the main portion of the app's main window. I want to write the code to switch views in

Re: Two Dimensional Array

2008-09-12 Thread Graff
On Sep 12, 2008, at 5:05 AM, Jordon Hirshon wrote: I'm new to Objective-C. Can someone suggest an approach to building a two dimensional array of integers? You can either make an NSArray that contains other NSArrays or just use a c-style multidimensional array. example of using an

Transparent Background for a Progress Indicator (NSView)

2008-09-12 Thread Simon
Hi guys, This is a quick question I hope! What's the most efficient way to make the progress indicator background transparent (I've got a screen shot of a quick test app[1])? Is there away to do this without redrawing the gradient in the background? I'm assuming that I could try and find

Re: Two Dimensional Array

2008-09-12 Thread Graff
On Sep 12, 2008, at 3:24 PM, Graff wrote: // create the 2-D array NSArray *twoD = [NSArray arrayWithObjects: [NSMutableArray new], [NSMutableArray new],

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jamie Hardt
On Sep 12, 2008, at 12:17 PM, Brad Gibbs wrote: I want to write the code to switch views in the MainWindowController.m, since it controls the window that contains the views that will be switched. But, the buttons that control the view switching are located on a panel being controlled by a

Re: Programmatically dismiss NSPopUpButton menu

2008-09-12 Thread Peter Ammon
On Sep 12, 2008, at 11:40 AM, Jeff Johnson wrote: I have a NSView that only appears in a window when a certain activity is in progress, and there's an NSPopUpButton in the view that acts as a gear menu with actions that relate to the activity in progress. The issue is that if the button's

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Brad Gibbs
Thanks for the reply. Unfortunately, the navigation panel is too complicated not to have a controller (it has several, actually). I haven't used the responder chain yet, but I'll give it a go. It's disappointing that there's no way to target the instance directly... On Sep 12, 2008, at

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
Hey Brad - So it sounds like you have two controllers, A, and B, and they each have their own NIB. Sound like you're on the right track. Now you want to have an action in B's NIB affect controller A. Does controller B have an instance variable, or other mechanism, for referencing

Re: Programmatically dismiss NSPopUpButton menu

2008-09-12 Thread Jeff Johnson
On Sep 12, 2008, at 3:16 PM, Peter Ammon wrote: On Sep 12, 2008, at 11:40 AM, Jeff Johnson wrote: I have a NSView that only appears in a window when a certain activity is in progress, and there's an NSPopUpButton in the view that acts as a gear menu with actions that relate to the activity

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jamie Hardt
On Sep 12, 2008, at 1:30 PM, Brad Gibbs wrote: It's disappointing that there's no way to target the instance directly... By design, an object freezedried in a nib cannot be connected to objects in other nibs, mainly because this would cause loading one nib to load others. If you have

App name from Bundle Identifier?

2008-09-12 Thread Dave DeLong
Hi everyone, I've been looking inside NSWorkspace, NSBundle, NSApplication, NSFileWrapper, etc for some way to get the display name of an application from it's bundle identifier, but I can't find anything. Is there a way to do this? For example, if I have com.apple.InterfaceBuilder3,

Re: App name from Bundle Identifier?

2008-09-12 Thread Jamie Hardt
Dave- Just a thought NSString *path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:bundleIdentifier]; NSString *appName = [[path lastPathComponent] stringByDeletingPathExtension]; On Sep 12, 2008, at 2:06 PM, Dave DeLong wrote: Hi everyone, I've been

Re: App name from Bundle Identifier?

2008-09-12 Thread Dave DeLong
Thanks for the idea. I'm sure it will work under most situations, but there are times when what's displayed in the Finder (ie it's absolute path) is not necessarily the same thing as the actual application name. For example, I have BBEdit 8 and BBEdit 9 (trial) right now. BBEdit 8 is at

Windows

2008-09-12 Thread John MacMullin
Does the standard Windows menu manage and show all application windows? If so, under what conditions do windows not get listed in the pull down? On the other hand, it is up to the programmer to manage the list and enable and disable windows as they become key and front? Thanks, John

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Brad Gibbs
If I'm reading your mail correctly, I've tried that without success. I have a MainWindowController controlling MainWindow. On MainWindow.xib is a button which launches another window (MainMenu,xib) with a window controller (MainMenuWindowController.m). A couple of NSViewControllers down

Re: Transparent Background for a Progress Indicator (NSView)

2008-09-12 Thread Corbin Dunn
On Sep 12, 2008, at 12:25 PM, Simon wrote: Hi guys, This is a quick question I hope! What's the most efficient way to make the progress indicator background transparent (I've got a screen shot of a quick test app[1])? Is there away to do this without redrawing the gradient in the

Re: App name from Bundle Identifier?

2008-09-12 Thread Ken Thomases
If you want the name displayed by the Finder, you want - [NSFileManager displayNameAtPath:]. If you want the name the app claims for itself, you want -[NSBundle objectForInfoDictionaryKey:] called on the bundle obtained from the path, passing (id)kCFBundleNameKey as the key. Cheers, Ken

Re: App name from Bundle Identifier?

2008-09-12 Thread Jonathan Hess
Hey Dave - You could start with -[NSWorkspace absolutePathForAppBundleWithIdentifier:] to get a path. Use that path to create an NSBundle instance with +[NSBundle bundleWithPath:], and then use the NSBundle to find the name. -[NSBundle objectForInfoDictionaryKey:] and -[NSBundle

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
On Sep 12, 2008, at 2:25 PM, Brad Gibbs wrote: If I'm reading your mail correctly, I've tried that without success. I have a MainWindowController controlling MainWindow. On MainWindow.xib is a button which launches another window (MainMenu,xib) with a window controller

when should my NSWindowController be released?

2008-09-12 Thread Paul Archibald
Hey folks, The app I am working on has 2 windows. My project has been to implement the 2nd window. I added a new nib file and a new class, MyController:NSWindowController. In the MainController:NSObject implementation, there is a MyController object, which can be shown or hidden by the

NSXMLParser and character entities?

2008-09-12 Thread Kai
When NSXMLParser hits a character entity like auml; (- German umlaut 'รค'), it sends parser:resolveExternalEntityName:systemID: to its delegate and if this is not implemented or returns nil, parser:parseErrorOccurred: is called with NSXMLParserUndeclaredEntityError. Am I supposed to

Re: NSTableView works in 10.5 but not in 10.4

2008-09-12 Thread Ellen Chou
Hi all, I have the similar problem in 10.4.x with another modaled dialog window that only contains NSOutlineView table with 3 columns data. I'm pretty sure reloadData is called. This modaled dialog shows the contents correctly in 10.5.2. Is there a call to refresh the display for the modaled

Re: Windows

2008-09-12 Thread Charles Steinman
--- On Fri, 9/12/08, John MacMullin [EMAIL PROTECTED] wrote: Does the standard Windows menu manage and show all application windows? If so, under what conditions do windows not get listed in the pull down? From the horse's mouth:

Re: NSTableView works in 10.5 but not in 10.4

2008-09-12 Thread Corbin Dunn
I still recommend the same steps to diagnose the problem: After your model has changed (ie: in awakeFromNib, or wherever you initialize things), call -reloadData. You can test this out by adding a breakpoint in Xcode on [NSTableView reloadData]. Have it print the bt, and see when it is

Re: App name from Bundle Identifier?

2008-09-12 Thread Citizen
On 12 Sep 2008, at 22:06, Dave DeLong wrote: I've been looking inside NSWorkspace, NSBundle, NSApplication, NSFileWrapper, etc for some way to get the display name of an application from it's bundle identifier, but I can't find anything. Is there a way to do this? For example, if I have

Re: Windows

2008-09-12 Thread John MacMullin
Ok, thanks. However, as it stands nothing is being added to the Window menu. The following code also fails. IBOutlet NSWindow *testWindowOutlet; This code is in the awakeFromNib [testWindowOutlet setTitle:[[NSBundle mainBundle] localizedStringForKey:@Test Stuff value:nil table:nil]];

Re: Windows

2008-09-12 Thread Peter Ammon
On Sep 12, 2008, at 2:26 PM, John MacMullin wrote: Does the standard Windows menu manage and show all application windows? If so, under what conditions do windows not get listed in the pull down? On the other hand, it is up to the programmer to manage the list and enable and disable

Re: Can anyone explain this?

2008-09-12 Thread Peter Ammon
On Sep 12, 2008, at 1:31 PM, Roland Silver wrote: Can anyone explain this? The value of the expression is apparently different from the value of a variable assigned to that expression: double pitch = A0Pitch * pow(2.0, ntones/ currentTonesPerOctave(voice)) ; NSLog(@expression value: %f,

Re: NSBezierPath lineToPoint: Rate

2008-09-12 Thread Graham Cox
On 13 Sep 2008, at 2:18 am, Ian was here wrote: I have an app that uses a pen tool. If I move the mouse slowly, the free-hand drawing looks smooth, but as I increase the speed at which I move the mouse, the line gets bumpy. I am calling lineToPoint: in the mouseDragged: method of my view.

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
On Sep 12, 2008, at 3:07 PM, Brad Gibbs wrote: Thanks for the help. I'm trying to understand your code suggestion below. My app isn't document-based, so I don't think I have a document to refer to... Can I just leave that part out, or will things work differently in a

Re: clearing NSView outside of drawRect:

2008-09-12 Thread Graham Cox
On 13 Sep 2008, at 1:29 am, Chinh Nguyen wrote: My selection is several pixels behind my mouse as I'm dragging it when I use setNeedsDisplay: This suggests you're handling the drag loop incorrectly. There's no reason this should be the case when using setNeedDisplay: - if you organise

Re: Windows

2008-09-12 Thread John MacMullin
I am using the standard, default Window menu. John On Sep 12, 2008, at 4:04 PM, Peter Ammon wrote: On Sep 12, 2008, at 2:26 PM, John MacMullin wrote: Does the standard Windows menu manage and show all application windows? If so, under what conditions do windows not get listed in the

Re: App name from Bundle Identifier?

2008-09-12 Thread Rainer Brockerhoff
At 17:06 -0700 12/09/08, [EMAIL PROTECTED] wrote: From: Jonathan Hess [EMAIL PROTECTED] References: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] Date: Fri, 12 Sep 2008 14:34:59 -0700 Message-ID: [EMAIL PROTECTED] ... Before displaying a localized name for your bundle, the Finder compares the

Re: clearing NSView outside of drawRect:

2008-09-12 Thread Graham Cox
On 13 Sep 2008, at 10:21 am, Graham Cox wrote: If you are using the rect to select objects, you can also pass it to other methods that find which objects it touches or encloses. To be clear - of course you'd do this in step (2), not step (3), then *draw* the feedback of being in a

Re: App name from Bundle Identifier?

2008-09-12 Thread Jason Coco
On Sep 12, 2008, at 18:26 , Citizen wrote: On 12 Sep 2008, at 22:06, Dave DeLong wrote: I've been looking inside NSWorkspace, NSBundle, NSApplication, NSFileWrapper, etc for some way to get the display name of an application from it's bundle identifier, but I can't find anything. Is

Re: when should my NSWindowController be released?

2008-09-12 Thread Ken Thomases
On Sep 12, 2008, at 4:44 PM, Paul Archibald wrote: So, what is the general outline of properly allocating, initializing and deallocating an application and its elements? Can someone point me to the right documentation? I can't seem to find reference to this subject. Here's the Memory

Re: when should my NSWindowController be released?

2008-09-12 Thread Jamie Hardt
On Sep 12, 2008, at 5:53 PM, Ken Thomases wrote: Cocoa doesn't bother doing a full release/dealloc of your application object (and the things it owns) at application termination. The principle is that the OS is about to cleanup the whole process's address space in one fell swoop, so

Core Data, Bindings, NSSearchField, and NSPopUpButton

2008-09-12 Thread Steve Mykytyn
I'm displaying a list of 100,000 or so global locations in an NSTableView, using an NSSearchField to help the user zero in on desired locations by street address, city, state, country, etc. It all works fine using Core Data plus bindings. And best of all no interface code... It would

Re: Core Data, Bindings, NSSearchField, and NSPopUpButton

2008-09-12 Thread Jamie Hardt
On Sep 12, 2008, at 6:09 PM, Steve Mykytyn wrote: It would be handy to add an NSPopupButton with the list of countries to optionally restrict the search to a specific country while looking for a city name in the searchfield, say. Can't seem to find any relevant examples of this kind of

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Brad Gibbs
I run into a stumbling block once I get to the first NSWindowController, whether I'm trying your method, or trying to use the Responder Chain, as Jamie suggested. I get what you're suggesting and I tried going that route before making the original post, but I don't know how to go from the

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Bill Bumgarner
On Sep 12, 2008, at 7:08 PM, Brad Gibbs wrote: [self.view.window.parentWindow.windowController removeChildWindow: [self.view.window]]; [self.view.window] doesn't make any sense. b.bum smime.p7s Description: S/MIME cryptographic signature ___

Bug with -changeAttributes: in NSFontManager/Font Panel?

2008-09-12 Thread Graham Cox
I'm using the Font Panel via NSFont Manager to change text attributes through a modal panel (in fact a sheet). I can change the font OK, as using -setTarget: I can set the target of the font manager to my modal panel. However, I never get the call to - changeAttributes:, so all the stuff

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
Hey Brad - What code is responsible for creating each of the two window controllers? Perhaps that code could tell each of the window controllers about each other. Or, it sounds like your application isn't document based. Are there ever multiple instances of the two windows you're

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Brad Gibbs
OK XCode doesn't put up any errors or any warnings for this code and the app works as intended. The code is in an NSViewController, so I was targeting the view controller's view and then the view's window. What is the correct approach? On Sep 12, 2008, at 7:09 PM, Bill Bumgarner

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Brad Gibbs
Hey Jon, It is a non-document-based app. Only one instance of each window should ever be open at one time. I have an AppController class that is the NSApp delegate. In the AppController's awakeFromNib I alloc the MainWindowController and initWithNib. In the MainWindowController, I

Re: Transparent Background for a Progress Indicator (NSView)

2008-09-12 Thread Michael Ash
On Fri, Sep 12, 2008 at 3:25 PM, Simon [EMAIL PROTECTED] wrote: Hi guys, This is a quick question I hope! What's the most efficient way to make the progress indicator background transparent (I've got a screen shot of a quick test app[1])? Is there away to do this without redrawing the

Re: when should my NSWindowController be released?

2008-09-12 Thread Michael Ash
On Fri, Sep 12, 2008 at 9:02 PM, Jamie Hardt [EMAIL PROTECTED] wrote: On Sep 12, 2008, at 5:53 PM, Ken Thomases wrote: Cocoa doesn't bother doing a full release/dealloc of your application object (and the things it owns) at application termination. The principle is that the OS is about to

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Bill Bumgarner
On Sep 12, 2008, at 8:24 PM, Brad Gibbs wrote: OK XCode doesn't put up any errors or any warnings for this code and the app works as intended. The code is in an NSViewController, so I was targeting the view controller's view and then the view's window. What is the correct approach?

Re: EPS

2008-09-12 Thread has
Georg Seifert wrote: [NSView dataWithEPSInsideRect:] does not seem to help, unless I build a dummy view, draw in it and then use this method. I believe that's the general idea. An NSBezierPath instance by itself doesn't really do anything unless/until you draw it into a suitable graphics