Re: Getting a list of all classes, etc...

2008-03-27 Thread Chris Suter
On 27/03/2008, at 4:59 PM, Graham Cox wrote: This worked well (after a little tweaking!) thanks - got the whole caboodle running now. I note that NSObject's superclass is NULL, so I had to switch the order of the while() test in order to correctly detect plain NSObjects (admittedly this wi

Re: Writing a preference pane that configures hotkeys?

2008-03-27 Thread Nathan Day
You probable have, try downloading it again from my site, you also might want to download my Popup Dock application and look at how the views are set up for the IB file within the p

Key icons?

2008-03-27 Thread Rick Mann
I'd like to implement something like Xcode's accelerator key- assignment prefs pane. Are there standard icons representing all the special keys on the keyboard? If so, how do I get at them? TIA, -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

Programmatically invoking Exposé?

2008-03-27 Thread Rick Mann
Is there any way to programmatically invoke Exposé? TIA, -- Rick ___ 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 cocoa-dev-admins(at)lists.apple.com

Re: Key icons?

2008-03-27 Thread Andrew Farmer
On 27 Mar 08, at 01:11, Rick Mann wrote: I'd like to implement something like Xcode's accelerator key- assignment prefs pane. Are there standard icons representing all the special keys on the keyboard? If so, how do I get at them? They're all Unicode characters. ⌘ is one of them; the rest are

A Tab after 4 SPACEs

2008-03-27 Thread Gerriet M. Denkmann
I would like to put an NSLeftTabStopType after every 4 blanks (' ' Unicode: SPACE) into my NSTextField. So I do: NSFont *usedFont = [ layoutManager substituteFontForFont: font ]; float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; and so on. Works perfectly for Monaco

Re: Programmatically invoking Exposé?

2008-03-27 Thread Jonathon Mah
Hi Rick, On 2008-03-27, at 18:47, Rick Mann wrote: Is there any way to programmatically invoke Exposé? You could open /Applications/Expose.app, depending on the level of flexibility you need. Jonathon Mah [EMAIL PROTECTED] ___ Cocoa-dev ma

Re: Ephemeral Changes

2008-03-27 Thread Jens Miltner
Am 26.03.2008 um 11:26 schrieb Gerriet M. Denkmann: I also can use Edit ► Undo Set (or Paste) Font but now the document gets dirty. Very bad. Also: the complete text gets selected. So what else do I have to implement? I tried setFont: and setFont:range:, but these seem never to be called. H

Re: A Tab after 4 SPACEs

2008-03-27 Thread Uli Kusterer
On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think an NSGlyph can be generated by typecasting a char. Since Monaco or Courier are monospaced, it just so

Re: Core Data/IB questions

2008-03-27 Thread Ian Jackson
If I may be so bold, I'd like to jump in on this question. I have a similar situation, but I want to have a table representing a to-many relationship for entity1, which the user can populate by choosing any number of entries from a entity2. e.g. entity2 has 50 entries. entity1 1st

Re: Getting a list of all classes, etc...

2008-03-27 Thread Graham Cox
Actually I did try it this way at one point, and it worked OK with one small kink. It caused the +initialize method of the classes being tested to get called, which for some classes (bearing in mind that it's going through a list of EVERY class in the runtime), triggered some warnings about

Re: Ephemeral Changes

2008-03-27 Thread Gerriet M. Denkmann
On 26 Mar 2008, at 22:56, Graham Cox wrote: The undo manager will directly change the data in the text view using an invocation or target/action - it doesn't go back through changeFont: normally, which is really a "high level" method. Maybe the solution to this is to subclass NSUndoManager

Getting other application window reference

2008-03-27 Thread Apparao Mulpuri
Hi, I am developing a Cocoa based application, which will access other application's window and do some resize operations. In Cocoa, is there any way to get other applications(includes non-scriptable ) window references? Thanks, - Apparao. ___

Master-Slave Display Exception - Cannot remove an observer

2008-03-27 Thread Steve Steinitz
Hello, I sent this just before the Easter break but didn't receive a reply. I thought I'd try again now that we're all back at work. I have what, in WebObjects, we used to call a master-slave display. I show a list of specific Products based on the selected Product Model, hereafter referre

method declaration error

2008-03-27 Thread Nick Rogers
i'm declaring the following method: - (BOOL)searchNodeTarget:(const ItemType)target location:(int &)location; with error: "parse error before '&' token". can we not use (int &) this way? Thanks, Nick ___ Cocoa-dev mailing list (Coco

Rép : method declaration error

2008-03-27 Thread Allison Newman
Um, I'm more of a C girl than Objective-C, but I think this holds true for the two languages: the ampersand is an operator used to get the address of a variable. What you need is an asterix - this is the symbol used to denote that you want a pointer to a type rather than the type itself. Alli

Re: method declaration error

2008-03-27 Thread Jonathan del Strother
On Thu, Mar 27, 2008 at 12:21 PM, Nick Rogers <[EMAIL PROTECTED]> wrote: > i'm declaring the following method: > > - (BOOL)searchNodeTarget:(const ItemType)target > location:(int &)location; > > with error: "parse error before '&' token". > > can we not use (int &) this way? Re

to include a C++ class in proj

2008-03-27 Thread Nick Rogers
are we allowed to do that in a cocoa proj. if so how do we declare the class. Is it like? class MyClass { } this is throwing error at the first line: parse error before 'MyClass' token what headers do i need to include for a C++ class? Thanks, Nick ___

Re: Ephemeral Changes

2008-03-27 Thread Jens Miltner
Am 27.03.2008 um 11:57 schrieb Gerriet M. Denkmann: On 26 Mar 2008, at 22:56, Graham Cox wrote: The undo manager will directly change the data in the text view using an invocation or target/action - it doesn't go back through changeFont: normally, which is really a "high level" method. May

Re: to include a C++ class in proj

2008-03-27 Thread Jens Miltner
Am 27.03.2008 um 14:44 schrieb Nick Rogers: are we allowed to do that in a cocoa proj. if so how do we declare the class. Is it like? class MyClass { } this is throwing error at the first line: parse error before 'MyClass' token what headers do i need to include for a C++ class? Make s

Re: to include a C++ class in proj

2008-03-27 Thread Sherm Pendley
On Thu, Mar 27, 2008 at 9:44 AM, Nick Rogers <[EMAIL PROTECTED]> wrote: > are we allowed to do that in a cocoa proj. > if so how do we declare the class. > > Is it like? > > class MyClass > { > > } > > this is throwing error at the first line: parse error before > 'MyClass' token To compile a f

Re: Getting other application window reference

2008-03-27 Thread Brian Kendall
I would recommend the accessibility API, since that can be used to find all the windows on screen as well as change their position and size. (URL: http://developer.apple.com/documentation/Cocoa/Conceptual/Accessibility/cocoaAXIntro/cocoaAXintro.html) Unfortunately, that won't let you use a

Re: to include a C++ class in proj

2008-03-27 Thread Nick Rogers
hi, the semicolon is there. i've changed extension to .hh and .mm, still the same error. Again what headers to include for a .hh file to be taken as a file declaring a C++ class? Wishes, Nick On 27-Mar-08, at 7:28 PM, Jens Miltner wrote: Am 27.03.2008 um 14:44 schrieb Nick Rogers: are

Re: to include a C++ class in proj

2008-03-27 Thread Scott Ribe
> Again what headers to include for a .hh file to be taken as a file > declaring a C++ class? None for what you posted. Headers are only needed to introduce declarations of classes, types, etc which you will use. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice

applicationWillTerminate and animations

2008-03-27 Thread Mitchell Livingston
Hello, When my program quits, I would like to fade out all the windows using the animator. When I put this code in the applicationWillTerminate: method, however, it appears to be called but doesn't animate. How would I got about to get this to work? Thank you, Mitchell Livingston

Re: Programmatically invoking Exposé?

2008-03-27 Thread Brian Kendall
The way I've done it, and mind you this is a bit of work and it's certainly not ideal, is to read the contents of com.apple.symbolichotkeys.plist to figure out what the current hotkey for any of the Expose actions are, and then use CGEventCreateKeyboardEvent and CGEventPost to synthesize

Re: to include a C++ class in proj

2008-03-27 Thread Brady Duga
On Mar 27, 2008, at 7:05 AM, Nick Rogers wrote: hi, the semicolon is there. i've changed extension to .hh and .mm, still the same error. What file did you change to .mm, the header or the source file? Remember, header files are not compiled (well, generally not), they are included in im

Re: Writing a preference pane that configures hotkeys?

2008-03-27 Thread Brian Kendall
It looks like I did have an early version. I downloaded the one from your website, rebuilt my pref pane and included a call to setReadyForHotKeyEvent, and now it works great. Thanks a lot for making a very cool and very useful NDHotKeyControl class! - Brian On Thu, 27 Mar 2008 03:21:01

Re: applicationWillTerminate and animations

2008-03-27 Thread Sherm Pendley
On Thu, Mar 27, 2008 at 10:14 AM, Mitchell Livingston <[EMAIL PROTECTED]> wrote: > Hello, > > When my program quits, I would like to fade out all the windows using > the animator. When I put this code in the applicationWillTerminate: > method, however, it appears to be called but doesn't animate.

NSMapTable with pointer keys ?

2008-03-27 Thread Guillaume Laurent
Hi all, I need to build a map of NSObjects indexed by void* pointers. Apparently the right way to do this is to use NSMapTable with the appropriate options : [NSMapTable mapTableWithKeyOptions:NSMapTableObjectPointerPersonality valueOptions:NSMapTableStrongMemory] (reading the doc for N

Re: Leopard on PPC

2008-03-27 Thread Clark Cox
On Wed, Mar 26, 2008 at 4:48 PM, Sherm Pendley <[EMAIL PROTECTED]> wrote: > On Wed, Mar 26, 2008 at 7:04 PM, Lorenzo <[EMAIL PROTECTED]> wrote: > > > Hi Laurent, > > I am going to debug and let you know. Right now I have found these lines. > > Might they cause the trouble on Leopard && PPC? > >

Re: Leopard on PPC

2008-03-27 Thread Clark Cox
On Wed, Mar 26, 2008 at 4:04 PM, Lorenzo <[EMAIL PROTECTED]> wrote: > Hi Laurent, > I am going to debug and let you know. Right now I have found these lines. > Might they cause the trouble on Leopard && PPC? > No, but this line will cause problems when/if you build for 64-bit: > number = CFN

Re: A Tab after 4 SPACEs

2008-03-27 Thread Uli Kusterer
On 27.03.2008, at 10:08, Uli Kusterer wrote: But the glyph with number 0x20 is probably a completely different width than the glyph corresponding to a space in other languages. I meant in other *fonts*, not languages. Cheers, -- Uli Kusterer "The Witnesses of TeachText are everywhere..." htt

Re: Leopard on PPC

2008-03-27 Thread Sherm Pendley
On Thu, Mar 27, 2008 at 11:25 AM, Clark Cox <[EMAIL PROTECTED]> wrote: > On Wed, Mar 26, 2008 at 4:48 PM, Sherm Pendley <[EMAIL PROTECTED]> > wrote: > > On Wed, Mar 26, 2008 at 7:04 PM, Lorenzo <[EMAIL PROTECTED]> wrote: > > > > > Hi Laurent, > > > I am going to debug and let you know. Right now

Re: Core Data/IB questions

2008-03-27 Thread Adam Gerson
Is what you are describing similar to the "To Dos" example at: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html Adam On Thu, Mar 27, 2008 at 5:33 AM, Ian Jackson <[EMAIL PROTECTED]> wrote: > If I may be so bold, I'd like to jump in on this question. I have a > similar situation,

Re: A Tab after 4 SPACEs

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 10:08, Uli Kusterer wrote: On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think an NSGlyph can be generated by typecasting a char. Since

IKImageEditPanel Effects Preview Question

2008-03-27 Thread Jamie Phelps
When I first invoke the IKImageEditPanel, the preview in the Effects tab reflects the image that is in my IKImageView. If I change the image in the image view, however, the preview in the Effects tab does not show the preview applied to the image currently in the image view but to the image

Re: Leopard on PPC

2008-03-27 Thread Matt Gough
OK, so where is that documented then? As I said, the CFBoolean reference says not a word about it: < http://developer.apple.com/documentation/CoreFoundation/Reference/CFBooleanRef/Reference/reference.html By contrast, every other toll-free bridged CF class I can think of explicitly do

Re: Leopard on PPC

2008-03-27 Thread Jean-Daniel Dupas
Le 27 mars 08 à 16:59, Sherm Pendley a écrit : On Thu, Mar 27, 2008 at 11:25 AM, Clark Cox <[EMAIL PROTECTED]> wrote: On Wed, Mar 26, 2008 at 4:48 PM, Sherm Pendley <[EMAIL PROTECTED] > wrote: On Wed, Mar 26, 2008 at 7:04 PM, Lorenzo <[EMAIL PROTECTED]> wrote: Hi Laurent, I am going to d

Re: Leopard on PPC

2008-03-27 Thread glenn andreas
On Mar 27, 2008, at 10:59 AM, Sherm Pendley wrote: CFBoolean *is* toll free bridged to NSNumber. OK, so where is that documented then? As I said, the CFBoolean reference says not a word about it: It's more subtle than that. CFNumber is toll-free bridged with NSNumber. "toll-free brid

Re: Getting a list of all classes, etc...

2008-03-27 Thread Ken Thomases
On Mar 26, 2008, at 11:43 PM, Graham Cox wrote: I have a class that can contain different objects which all derive from a class R. The container can accept instances of any subclass of R. Each subclass of R implements a CLASS method for a particular feature, returning an array. The contain

Re: Leopard on PPC

2008-03-27 Thread Sherm Pendley
On Thu, Mar 27, 2008 at 12:22 PM, glenn andreas <[EMAIL PROTECTED]> wrote: > > On Mar 27, 2008, at 10:59 AM, Sherm Pendley wrote: > > >>> CFBoolean *is* toll free bridged to NSNumber. > > > > > > OK, so where is that documented then? As I said, the CFBoolean > > reference > > says not a word about

Re: A Tab after 4 SPACEs

2008-03-27 Thread glenn andreas
On Mar 27, 2008, at 11:12 AM, Gerriet M. Denkmann wrote: On 27 Mar 2008, at 10:08, Uli Kusterer wrote: On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think

NSScroller question

2008-03-27 Thread slasktrattenator
Hi, NSScroller has a small view, by default two pixels high, just above the scroller and below the NSTableHeaderView's corner view. How can I get at this view? If you look at the XCode interface you can see they have put an icon in this view (the one that splits the editor view) and made it larger

Re: NSMapTable with pointer keys ?

2008-03-27 Thread Benjamin Stiglitz
[NSMapTable mapTableWithKeyOptions:NSMapTableObjectPointerPersonality valueOptions:NSMapTableStrongMemory] (reading the doc for NSMap, I figured these are the right options) However, when trying to fetch an object with a void* key to check for its presence (using the C api as recommended)

Re: NSMapTable with pointer keys ?

2008-03-27 Thread Guillaume Laurent
On Mar 27, 2008, at 17:51 , Benjamin Stiglitz wrote: [NSMapTable mapTableWithKeyOptions:NSMapTableObjectPointerPersonality valueOptions:NSMapTableStrongMemory] (reading the doc for NSMap, I figured these are the right options) However, when trying to fetch an object with a void* key to ch

Re: outlineViewSelectionDidChange not called

2008-03-27 Thread Adam Gerson
> Ah.. I'm not quite sure you got what I meant. In a (document-based) > app set up an NSArray *selectionIndexPaths ivar, so the > NSTreeController then binds its @"selectionIndexPaths" binding to the > keypath @"File's Owner.selectionIndexPaths" where file's owner is the > owner of the nib co

Re: NSMapTable with pointer keys ?

2008-03-27 Thread Guillaume Laurent
On Mar 27, 2008, at 17:54 , A.M. wrote: On Mar 27, 2008, at 11:24 AM, Guillaume Laurent wrote: Hi all, I need to build a map of NSObjects indexed by void* pointers. Apparently the right way to do this is to use NSMapTable with the appropriate options : [NSMapTable mapTableWithKeyOpt

Re: Ephemeral Changes

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 09:50, Jens Miltner wrote: Am 26.03.2008 um 11:26 schrieb Gerriet M. Denkmann: I also can use Edit ► Undo Set (or Paste) Font but now the document gets dirty. Very bad. Also: the complete text gets selected. So what else do I have to implement? I tried setFont: and setFo

Re: Ephemeral Changes

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 14:46, Jens Miltner wrote: Am 27.03.2008 um 11:57 schrieb Gerriet M. Denkmann: On 26 Mar 2008, at 22:56, Graham Cox wrote: The undo manager will directly change the data in the text view using an invocation or target/action - it doesn't go back through changeFont: normal

NSToolbar doesn't add default items issue on 10.5.2

2008-03-27 Thread Martin Redington
I've got some NSToolbar code, which seems to have suddenly stopped working on Leopard only. - (void) setupToolbar { NSLog(@"Setting up toolbar"); //[self removeObsoleteToolbarIdentifiers]; NSToolbar *toolbar = [[MMICleanerToolbar alloc] initWithIdentifier:@"Cleaner

NSTextField and IB Weirdness

2008-03-27 Thread Mike
I am using Xcode 2.5 and IB Version 2.5.6 (489). I have a window with two NSTextFields. Both are static. I've verified all my outlets and connections are valid. Both outlet types are set to NSTextField in IB's inspector pallette. However, when I generate the class files, no matter what I do, t

setMenuVisible

2008-03-27 Thread Wesley Smith
I'm trying to make an NSWindow that takes up the entire screen including the menu bar but is not actually a fullscreen window. I know this is possible with Carbon, but I can't figure it out with Cocoa. Whenever I call [NSMenu setMenuVisible:TRUE], the menubar goes away, but so does my window. I

Re: outlineViewSelectionDidChange not called

2008-03-27 Thread Hamish Allan
On Thu, Mar 27, 2008 at 5:17 PM, Adam Gerson <[EMAIL PROTECTED]> wrote: > Ok, I understand. So I bind both the OutlineView and the > TreeController to a third object that keeps them both in sync to the > same SelectionIndexPath value. No -- you bind the view to the controller and the controlle

Re: NSToolbar doesn't add default items issue on 10.5.2

2008-03-27 Thread Peter Ammon
On Mar 27, 2008, at 10:58 AM, Martin Redington wrote: On Tiger, I can see the delegates -toolbarDefaultItemIdentifiers: method get called, followed by the NSToolbarItem calls, after the setToolbar: method. On Leopard (10.5.2/9C31) [latest security update not installed yet], the delega

Core Data & IB in prefs pane

2008-03-27 Thread Rick Mann
I'm trying to use what I learned yesterday about Core Data in a System Prefs pane. I created an Entity data model, and then tried to add an NSTable and some buttons and wire them up the same way I'd seen the Core Data Entity tool do it in IB. But, it didn't work. So I tried using the Core D

programatically show NSSegmentedCell menu?

2008-03-27 Thread Jesse Grosjean
I'm trying to programatically show a NSSgetmentedCell menu, as if the user has clicked on that segmented cell. For normal popup buttons you can do this with 'performClick:', but that doesn't work for segmented controls, because it will always just perform the click on the middle cell. Is th

Re: Interface Builder

2008-03-27 Thread Thiago Rossi
Well, I tried some things at home but didn't get success. =( I'm trying to do this: I have a controller with an array of accounts. And these albums has a type associated to it. For example: ACCOUNT 01 - BANK ACCOUNT ACCOUNT 02 - BANK ACCOUNT ACCOUNT 03 - LOAN ACCOUNT ACCOUNT 04 - BANK ACCOUNT I w

Re: programatically show NSSegmentedCell menu?

2008-03-27 Thread Bob Clark
On Mar 27, 2008, at 1:21 PM, Jesse Grosjean wrote: I'm trying to programatically show a NSSgetmentedCell menu, as if the user has clicked on that segmented cell. For normal popup buttons you can do this with 'performClick:', but that doesn't work for segmented controls, because it will alway

Re: Leopard on PPC

2008-03-27 Thread Scott Thompson
On Mar 27, 2008, at 10:29 AM, Clark Cox wrote: On Wed, Mar 26, 2008 at 4:04 PM, Lorenzo <[EMAIL PROTECTED]> wrote: Hi Laurent, I am going to debug and let you know. Right now I have found these lines. Might they cause the trouble on Leopard && PPC? No, but this line will cause problems wh

Re: programatically show NSSegmentedCell menu?

2008-03-27 Thread Jesse Grosjean
Bob, Thanks, but that only seems to select the cell. I want to temporarily highlight the cell, and show the menu, as if the user has clicked on it. Anyway looking into synthesizing the mouse event now. Jesse On Mar 27, 2008, at 4:32 PM, Bob Clark wrote: On Mar 27, 2008, at 1:21 PM, Jesse

Static in Subclasses

2008-03-27 Thread Justin Giboney
I need to create a series of classes that implement the Singleton design pattern. These classes have a lot of similar methods (I am trying to create a series of DAOs see: http://en.wikipedia.org/wiki/Data_Access_Object) . I was thinking that it would be best to create a super class, and a

Re: applicationWillTerminate and animations

2008-03-27 Thread Troy Stephens
On Mar 27, 2008, at 7:14 AM, Mitchell Livingston wrote: Hello, When my program quits, I would like to fade out all the windows using the animator. When I put this code in the applicationWillTerminate: method, however, it appears to be called but doesn't animate. How would I got about to ge

Re: NSScroller question

2008-03-27 Thread Troy Stephens
On Mar 27, 2008, at 9:50 AM, [EMAIL PROTECTED] wrote: Hi, NSScroller has a small view, by default two pixels high, just above the scroller and below the NSTableHeaderView's corner view. How can I get at this view? If you look at the XCode interface you can see they have put an icon in this view

Re: Static in Subclasses

2008-03-27 Thread Ken Thomases
On Mar 27, 2008, at 3:44 PM, Justin Giboney wrote: I need to create a series of classes that implement the Singleton design pattern. These classes have a lot of similar methods (I am trying to create a series of DAOs see: http://en.wikipedia.org/wiki/ Data_Access_Object). I was thinking th

Re: CoreAnimation weird problems with NSView animator

2008-03-27 Thread Troy Stephens
On Mar 26, 2008, at 9:12 AM, Milen Dzhumerov wrote: Hi all, I've been playing with CA today and encountered some weird problems. Firstly, I tested setHidden: on an animator on a NSSegmentedView and it worked fine - it gets faded in/out. Now, all the problems I encountered happen in another

Re: Static in Subclasses

2008-03-27 Thread Hamish Allan
On Thu, Mar 27, 2008 at 8:44 PM, Justin Giboney <[EMAIL PROTECTED]> wrote: > How can I get a variable that is static to each subclass, but that is > declared in the super class? In short, you can't. "static" in C means "within the scope of the source file". Split your subclasses off into their

Re: How to get current renderer for an NSOpenGLView?

2008-03-27 Thread Troy Stephens
On Mar 26, 2008, at 2:54 PM, Duncan Champney wrote: I need to find out the amount of total VRAM and available VRAM in the current renderer before creating a large renderbuffer object, to make sure I don't choke the system in doing it. I know how to find the current renderer for a given displ

Re: Static in Subclasses

2008-03-27 Thread Troy Stephens
On Mar 27, 2008, at 2:05 PM, Hamish Allan wrote: On Thu, Mar 27, 2008 at 8:44 PM, Justin Giboney <[EMAIL PROTECTED]> wrote: How can I get a variable that is static to each subclass, but that is declared in the super class? In short, you can't. "static" in C means "within the scope of the sour

Re: Getting a list of all classes, etc...

2008-03-27 Thread Chris Suter
On 28/03/2008, at 3:23 AM, Ken Thomases wrote: On Mar 26, 2008, at 11:43 PM, Graham Cox wrote: I have a class that can contain different objects which all derive from a class R. The container can accept instances of any subclass of R. Each subclass of R implements a CLASS method for a par

Re: NSMapTable with pointer keys ?

2008-03-27 Thread Guillaume Laurent
On Mar 27, 2008, at 18:17 , Guillaume Laurent wrote: On Mar 27, 2008, at 17:54 , A.M. wrote: I think you would have an easier time with NSMutableDictionary and [NSValue valueWithPointer:&x] as the key. Thanks, I'll try that too. Indeed, that seem to be the simplest solution. I could

Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread Nathan Vander Wilt
If I make two identical string constants (@"samestring" and @"samestring") in my Cocoa program, are their pointers guaranteed to be equal? I assumed this without thinking while prototyping root objects in an NSOutline view and it did work, however I just realized that perhaps I shouldn't rely on th

Re: NSScroller question

2008-03-27 Thread slasktrattenator
Thanks, but the corner view is the right side corner of the header view, right? I was talking about the small view just below it, on top of the vertical slider and part of the slider itself. It's a tiny view of about 2 pixels height. I believe it corresponds to NSScrollerNoPart, but I'm not sure.

Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread Bill Bumgarner
On Mar 27, 2008, at 4:20 PM, Nathan Vander Wilt wrote: So does that mean once I'm up at the Cocoa level, that constant strings *are* guaranteed to have the same pointer if their contents are the same? What is "unique" and what is a "module" in this context? They might be unique, they might not.

Re: NSScroller question

2008-03-27 Thread Troy Stephens
On Mar 27, 2008, at 4:26 PM, [EMAIL PROTECTED] wrote: Thanks, but the corner view is the right side corner of the header view, right? I was talking about the small view just below it, on top of the vertical slider and part of the slider itself. It's a tiny view of about 2 pixels height. I believ

Re: A Tab after 4 SPACEs

2008-03-27 Thread Alastair Houghton
On 27 Mar 2008, at 16:12, Gerriet M. Denkmann wrote: Current I am using: NSString *dummyString = [ NSString stringWithUTF8String: " " ]; NSTextView *dummyTextView = [ [ NSTextView alloc ] initWithFrame: NSMakeRect(0,0,1e4,1e4) ]; [ dummyTextView setString: dummyString ]; [ dummyTextVi

Core Data faulting and bindings: recursive KVO notifications?

2008-03-27 Thread Dennis Lorson
Hi, I have a Core Data (single-doc) application in which I have a medium- complex object graph. In this application, a main entity (Image) forms the master part (they are displayed in a list), and this entity has several properties. I use an array controller to manage the Image selection, an

Re: NSToolbar doesn't add default items issue on 10.5.2

2008-03-27 Thread Martin Redington
On 27 Mar 2008, at 19:34, Peter Ammon wrote: On Mar 27, 2008, at 10:58 AM, Martin Redington wrote: On Tiger, I can see the delegates -toolbarDefaultItemIdentifiers: method get called, followed by the NSToolbarItem calls, after the setToolbar: method. On Leopard (10.5.2/9C31) [latest

Subverting the first responder chain

2008-03-27 Thread John Stiles
I am implementing a custom NSView subclass (actually a simple subclass of NSOpenGLView) that implements -keyDown: in order to respond to user typing. Typically, this works great. However, I have a few menu items which respond to atypical hotkeys (e.g. one responds to "space", another to "optio

Re: Subverting the first responder chain

2008-03-27 Thread Hamish Allan
On Fri, Mar 28, 2008 at 12:52 AM, John Stiles <[EMAIL PROTECTED]> wrote: > However, I have a few menu items which respond to atypical hotkeys (e.g. > one responds to "space", another to "option+X"). In this case, I've > found that the view gets a -keyDown: event, which it dutifully handles, Pe

error strings in NSPropertyListSerialization

2008-03-27 Thread B.J. Buchalter
In the docs for [NSPropertyListSerialization propertyListFromData:mutabilityOption:format:errorDescription:] it has the following comment: Special Considerations -- Strings returned in errorString needed to be released by the caller prior to Mac OS X version 10.5. In

Re: Subverting the first responder chain

2008-03-27 Thread John Stiles
The view doesn't immediately have a way of knowing whether it should handle a key like "space" or not. The app design is predicated around the idea that keyboard shortcuts will be consumed before they reach the view, which I think is reasonable, and matches reality for standard command keys.

Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread Jens Alfke
On 27 Mar '08, at 4:20 PM, Nathan Vander Wilt wrote: So does that mean once I'm up at the Cocoa level, that constant strings *are* guaranteed to have the same pointer if their contents are the same? What is "unique" and what is a "module" in this context? The linker coalesces multiple identic

Re: NSScroller question

2008-03-27 Thread slasktrattenator
Yes, I meant scroller, not slider. Just had a glass of wine too much :-) Actually I don't want to add an accessory view, I want to get rid of the one that appears to be there by default. I have attached a screenshot showing what I'm talking about. The yellow part is the knob, drawn by filling the

Re: error strings in NSPropertyListSerialization

2008-03-27 Thread Jens Alfke
On 27 Mar '08, at 6:10 PM, B.J. Buchalter wrote: I am writing code that is linked to the 10.4u SDK. Does this mean that I need to release the string? Yes. What happens if my app is run under 10.5? Cocoa detects that your code was linked with the 10.4 SDK and follows the old behavior. (

CGContextReplacePathWithStrokedPath problem?

2008-03-27 Thread Graham Cox
I'm using CGContextReplacePathWithStrokedPath to get an outline of a stroke, but it seems to ignore the current line cap, join and dash settings (it does thankfully honour the line width though, so it's not entirely useless). Can someone confirm that, or am I doing something wrong? --

Re: Subverting the first responder chain

2008-03-27 Thread Hamish Allan
On Fri, Mar 28, 2008 at 1:14 AM, John Stiles <[EMAIL PROTECTED]> wrote: > The view doesn't immediately have a way of knowing whether it should handle > a key like "space" or not. The app design is predicated around the idea that > keyboard shortcuts will be consumed before they reach the view, wh

Re: Static in Subclasses

2008-03-27 Thread Jon Gordon
On Mar 27, 2008, at 5:17 PM, [EMAIL PROTECTED] wrote: Date: Thu, 27 Mar 2008 14:44:17 -0600 From: Justin Giboney <[EMAIL PROTECTED]> Subject: Static in Subclasses To: Cocoa Developers Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII; format=flow

Re: error strings in NSPropertyListSerialization

2008-03-27 Thread Adam R. Maxwell
On Mar 27, 2008, at 6:10 PM, B.J. Buchalter wrote: In the docs for [NSPropertyListSerialization propertyListFromData:mutabilityOption:format:errorDescription:] it has the following comment: Special Considerations -- Strings returned in errorString needed to be release

Re: NSScroller question

2008-03-27 Thread Hamish Allan
On Fri, Mar 28, 2008 at 1:17 AM, <[EMAIL PROTECTED]> wrote: > The white part above the slot is by > default black, but here I made it white by filling the rect returned > by calling [self rectForPart:NSScrollerNoParts]. [self rectForPart:NSScrollerNoPart] simply returns a rect in the scroller

Re: CGContextReplacePathWithStrokedPath problem?

2008-03-27 Thread Graham Cox
Never mind, I was doing something wrong - it does honour all of those settings ;-) Apologies for doubting Quartz's engineers! (BTW, an aside: since Quartz has the ability to do this sort of bezier curve fitting, how about exposing more of it in the API? It would be great to be able to "unfl

Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread Kyle Sluder
On Thu, Mar 27, 2008 at 9:16 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > The linker coalesces multiple identical string constants into a single > value in the data segment. However, you can still end up with multiple > copies if your code was linked in separate pieces and then joined > together

Re: Subverting the first responder chain

2008-03-27 Thread Ken Thomases
On Mar 27, 2008, at 7:52 PM, John Stiles wrote: I am implementing a custom NSView subclass (actually a simple subclass of NSOpenGLView) that implements -keyDown: in order to respond to user typing. Typically, this works great. However, I have a few menu items which respond to atypical hotke

Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread Ken Thomases
On Mar 27, 2008, at 9:41 PM, Kyle Sluder wrote: But it still makes sense to me that when I'm providing NSString constants to be used as they are in the case of an NSError's userInfo dictionary, for example, that pointer comparison is still valid. Of course I wouldn't do it for places where I ex

Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread glenn andreas
On Mar 27, 2008, at 9:41 PM, Kyle Sluder wrote: On Thu, Mar 27, 2008 at 9:16 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: The linker coalesces multiple identical string constants into a single value in the data segment. However, you can still end up with multiple copies if your code was link

Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee?

2008-03-27 Thread Kyle Sluder
On Thu, Mar 27, 2008 at 10:52 PM, glenn andreas <[EMAIL PROTECTED]> wrote: > Bad Idea. > > Consider that, at some point, you move your code into a framework that > you can reuse in multiple projects. While the linker can coalesce > constant strings within a single binary, it obviously doesn't

Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee?

2008-03-27 Thread Kyle Sluder
On Thu, Mar 27, 2008 at 10:55 PM, Jeff Laing <[EMAIL PROTECTED]> wrote: > What confuses me is that people keep talking about @"constant" as though > it were a 'string constant' > > Its not, it's an Objective-C object that you can send messages to. > [snip] > What is the subtlety here that I mu

embed screen sharing in a cocoa app?

2008-03-27 Thread Adam Gerson
With 10.5's new screen sharing ability is there away to embed screen sharing into my app? I would like to pop up a window in my cocoa app that allows a user to remote view or control the desktop of another mac. I know I can launch the screen sharing app externally with vnc:// Thanks, Adam

Re: Subverting the first responder chain

2008-03-27 Thread John Stiles
Wow, this sounds like a disaster. Maybe in my -keyDown: call I can walk the menus in the menu bar and call -performKeyEquivalent on all of them. It's probably not fast :| I was in the process of writing code that stores the menu bar's key equivalents in a hash table and checks the hash table b

Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee?

2008-03-27 Thread Jens Alfke
On 27 Mar '08, at 7:59 PM, Kyle Sluder wrote: On Thu, Mar 27, 2008 at 10:55 PM, Jeff Laing <[EMAIL PROTECTED] > wrote: What confuses me is that people keep talking about @"constant" as though it were a 'string constant' Its not, it's an Objective-C object that you can send messages to. [sni

  1   2   >