Re: to store item pointer in NSButtonCell's subclass in NSOutlineView implementation

2008-04-06 Thread Nick Rogers
Hi, OR better yet is there a way to store the cell's pointer in my item. On 06-Apr-08, at 2:14 PM, Nick Rogers wrote: Hi, I have the first column of NSOutlineView containing NSButtonCell. I'm setting this in awakeFromNib. If I subclass NSButtonCell and declare that subClass as the data cell f

to store item pointer in NSButtonCell's subclass in NSOutlineView implementation

2008-04-06 Thread Nick Rogers
Hi, I have the first column of NSOutlineView containing NSButtonCell. I'm setting this in awakeFromNib. If I subclass NSButtonCell and declare that subClass as the data cell for the column, is there a way to store the item pointer into that subclass? If yes what method should I over-ride in N

Re: Scaling a window background image quickly

2008-04-06 Thread Jean-Daniel Dupas
Le 6 avr. 08 à 10:50, Heinrich Giesen a écrit : Hi, your PDF image is a beast, its size is 624 kB and contains a lot of complicated structures. I converted the PDF into an equivalent (same size and with alpha) PNG-file with only 28 kB. But that is only important for the first drawing where

Re: Scaling a window background image quickly

2008-04-06 Thread Heinrich Giesen
Hi, your PDF image is a beast, its size is 624 kB and contains a lot of complicated structures. I converted the PDF into an equivalent (same size and with alpha) PNG- file with only 28 kB. But that is only important for the first drawing where an NSImage with only one representation (NSPDFIm

Re: how to hack my own apps

2008-04-06 Thread alex
Just to add to this discussion- in _most_ cases ANY piece of code that is loaded into RAM can be _easily_ reversed. I think there are like two exceptions to that! I used to do this sort of thing on paper with colored pencils but now you can use a tool like IDA Pro (which rocks by the way)

Saving AttributedString with Attachments to RTFD

2008-04-06 Thread fred . redcliffe
Dear All I am trying to save an AttributedString with attachments to a RTFD file. I am converting the Attributed string to NSData using: NSData *textData = [ exportText RTFDFromRange:textRange documentAttributes:nil ]; and then saving it to fileName: [ textData wri

Re: Saving AttributedString with Attachments to RTFD

2008-04-06 Thread Jean-Daniel Dupas
Le 6 avr. 08 à 17:39, [EMAIL PROTECTED] a écrit : Dear All I am trying to save an AttributedString with attachments to a RTFD file. I am converting the Attributed string to NSData using: NSData *textData = [ exportText RTFDFromRange:textRange documentAttributes:nil ]; a

Re: Saving AttributedString with Attachments to RTFD

2008-04-06 Thread Reza Farhad
Jean Thanks for that, and it worked, but I am still surprised that I could not generate the file form the data. Is this a bug? Fred On 6 Apr 2008, at 16:54, Jean-Daniel Dupas wrote: Le 6 avr. 08 à 17:39, [EMAIL PROTECTED] a écrit : Dear All I am trying to save an AttributedString with

Re: Objective-C Instance Variable Names

2008-04-06 Thread Scott Andrew
See i still use m_xxx. Alot of it is just old habit from C++ land. But it really stands out to me m_ tells me its a member. We are also converting a lot non-mac programmers to mac so I think for them it makes the code a bit easier to read. I don't use the how hungarian (lpcstr for consant s

Re: How do I embed a font in an app?

2008-04-06 Thread Jens Alfke
On 4 Apr '08, at 3:37 PM, Jens Alfke wrote: In my application's user interface I want to use some TrueType fonts which are not built into the OS. (Yes, they're free and their licenses allow this sort of use.) I thought I remembered a way to embed fonts in an application bundle, or to progr

Re: Place NSView into NSView

2008-04-06 Thread Jens Alfke
On 5 Apr '08, at 4:47 PM, Lincoln Green wrote: [secondView setFrame:[firstView frame]]; This should be [secondView setFrame:[firstView bounds]]; The frame is the view's rectangle in its parent's coordinate system; the bounds is its rect in its own coordinates. So secondView

Re: how to hack my own apps

2008-04-06 Thread Jens Alfke
On 6 Apr '08, at 8:18 AM, alex wrote: Just to add to this discussion- in _most_ cases ANY piece of code that is loaded into RAM can be _easily_ reversed. I think there are like two exceptions to that! O'Reilly's "Secure Programming Cookbook" has a chapter on making code resistant to cr

Re: Saving AttributedString with Attachments to RTFD

2008-04-06 Thread Jean-Daniel Dupas
RTFD is not a File, i'ts a bundle. Try to right clic on it in the Finder ;-) Le 6 avr. 08 à 18:15, Reza Farhad a écrit : Jean Thanks for that, and it worked, but I am still surprised that I could not generate the file form the data. Is this a bug? Fred On 6 Apr 2008, at 16:54, Jean-Da

Re: Delegate not getting called for CATiledLayer

2008-04-06 Thread douglas a. welton
Hi John, I have solved the problem. My view was being used as the documentView in a NSScrollView class. The AppKit release notes clearly state that if you want to use a layer- backed view as a documentView, that you should also set the NSScrollView to "wantsLayer". I had not set the NSScr

Re: NSVector, CGVector Additions

2008-04-06 Thread Mike Abdullah
I would very strongly recommend using your own class prefix, not NS or CG. If Apple ever does choose to include such a class/structure in a future release of OS X your current code would be screwed. On 6 Apr 2008, at 19:22, Stefan Hafeneger wrote: Hi, I made a NSVector struct inclusive the

Re: NSVector, CGVector Additions

2008-04-06 Thread Stefan Hafeneger
This is kind of a class Addition so the NS prefix should be okay. Am 06.04.2008 um 20:43 schrieb Mike Abdullah: I would very strongly recommend using your own class prefix, not NS or CG. If Apple ever does choose to include such a class/structure in a future release of OS X your current code

Re: Scaling a window background image quickly

2008-04-06 Thread Kyle Sluder
On Sun, Apr 6, 2008 at 6:41 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: > This works well with lightweight PDF, but apparently not for complex one. I'm concerned as to why this PDF is so complicated in the first place. What's being drawn is actually really simple. Four bezier paths to draw

Re: How do I embed a font in an app?

2008-04-06 Thread Kyle Sluder
On Sun, Apr 6, 2008 at 12:43 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > FYI, Ben Stiglitz emailed me an even simpler solution that requires no code > at all: Unfortunately the docs don't seem to mention if this is a Leopard-only key. Can someone confirm either way? --Kyle Sluder __

Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
Hi Guys, This one has me stumped. I have a NSSegmentedControl with a segment that has a menu attached. I set up the menu like this NSMenu *actionMenu = [[[NSMenu alloc] initWithTitle:@"actionMenu"] autorelease]; NSMenuItem *newFileItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedStr

Re: NSVector, CGVector Additions

2008-04-06 Thread Colin Cornaby
It doesn't really matter if your code is intended to dovetail Cocoa classes. Mike is right. Using the NSVector class name prevents Apple from using it later. (Although I'm glad someone else has taken note of the lack of vector structures and math.) Sent from my iPhone On Apr 6, 2008, at

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread j o a r
On Apr 6, 2008, at 12:01 PM, Jonathan Dann wrote: However the command-G does not show up on the menu. The same happens if I set the key equivalent to @"p", @"q" and some others, but equivalents like @"u" and @"b" work fine. Can anyone verify this for me please as I think I'm going mad.

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread j o a r
On Apr 6, 2008, at 12:37 PM, Jonathan Dann wrote: Yeah I thought that, but couldn't see where g was defined. Typically under Edit > Find Any idea why it works in other contextual menus, including the main menu? Please file a bug report and ask for improved documentation:

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
On Apr 6, 2008, at 12:01 PM, Jonathan Dann wrote: However the command-G does not show up on the menu. The same happens if I set the key equivalent to @"p", @"q" and some others, but equivalents like @"u" and @"b" work fine. Can anyone verify this for me please as I think I'm going mad.

Re: Scaling a window background image quickly

2008-04-06 Thread Mike R. Manzano
The bottom gradient is curved so it'd be a bit more difficult to do it with CTGradient, which does linear and radial gradients only. Regardless, I've abandoned this PDF and opted for a much simpler design that uses CTGradient and beziers like you've suggested. A side- effect is that I get be

Image Processing

2008-04-06 Thread Lorenzo
Still working with image-processing... I have a source image 1680 x 1050 with (just a case) 240 dpi. I load it with sourceImage = [[NSImage alloc] initWithContentsOfFile:path]]; But when I ask for its size with NSSize imageSize = [sourceImage size]; I don¹t get the real pixel size (168

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
On 6 Apr 2008, at 20:47, j o a r wrote: On Apr 6, 2008, at 12:37 PM, Jonathan Dann wrote: Yeah I thought that, but couldn't see where g was defined. Typically under Edit > Find Any idea why it works in other contextual menus, including the main menu? Please file a bug report and ask

UIView animation

2008-04-06 Thread Benjamin BERTRAND
Hi, I'm new to cocoa and have started to develop a board game for the iPhone. I've been looking at the "ColorSlidingPuzzle" example provided by Apple. I managed to animate a piece move using the function: - (void) movePiece:(Move*) move { [UIView beginAnimations:nil context:nil]; [UIView setAn

Re: Scaling a window background image quickly

2008-04-06 Thread glenn andreas
On Apr 6, 2008, at 3:30 PM, Mike R. Manzano wrote: The bottom gradient is curved so it'd be a bit more difficult to do it with CTGradient, which does linear and radial gradients only. Regardless, I've abandoned this PDF and opted for a much simpler design that uses CTGradient and beziers l

Beginner reading, etc.

2008-04-06 Thread andy knasinski
I searched the archives and found some old posts, but i'm wondering what current titles are good for someone looking to start cocoa development. I've done some C development in the past with Code Warrior (QuarkXtensions and FileMaker Extensions) but would like to get up to speed with cocoa

Re: Objective-C Instance Variable Names

2008-04-06 Thread John Stiles
You can't be KVC compliant if you use prefixes like m_, so this limits your potential for using things like bindings. When I write C++, I am also a fan of m_, but it's just not appropriate for Cocoa since it basically means you're fighting against the frameworks. Scott Andrew wrote: See i stil

Re: Objective-C Instance Variable Names

2008-04-06 Thread Chris Suter
On 07/04/2008, at 9:39 AM, John Stiles wrote: You can't be KVC compliant if you use prefixes like m_, so this limits your potential for using things like bindings. I think you can be KVC compliant but you have to define setters and getters for everything. - Chris _

Re: Objective-C Instance Variable Names

2008-04-06 Thread Jim Correia
On Apr 6, 2008, at 7:39 PM, John Stiles wrote: You can't be KVC compliant if you use prefixes like m_, so this limits your potential for using things like bindings. Yes and no. KVC doesn't care what the iVar name is if you write KCV compliant accessor methods (or use properties.) KVC won'

Re: Objective-C Instance Variable Names

2008-04-06 Thread E. Wing
> I just name the all my instance variables "the_instance_var_" , and > the local ones "theLocalVar", this keep me well informed about if X > var is instance or local :). > I do something a little different. For member variables, I use camelCase and for for local variables I use_underscores. For

Re: KVC - how to get properties into a common form?

2008-04-06 Thread Graham Cox
Thanks for your thoughts, in fact this is exactly what I ended up doing (categories on each object type of interest) and it works great. As you said Jens, for arrays, dictionaries and sets in particular there isn't a way to predict the "best" option for presentation so doing it myself was

Re: Objective-C Instance Variable Names

2008-04-06 Thread Clark Cox
On Sun, Apr 6, 2008 at 4:39 PM, John Stiles <[EMAIL PROTECTED]> wrote: > You can't be KVC compliant if you use prefixes like m_, so this limits your > potential for using things like bindings. Of course you can, as long as you define accessors: //Pre-Leopard: @interface MyObject : NSObject { in

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Michael Ash
On Sun, Apr 6, 2008 at 3:37 PM, Jonathan Dann <[EMAIL PROTECTED]> wrote: > > > > > On Apr 6, 2008, at 12:01 PM, Jonathan Dann wrote: > > > > > However the command-G does not show up on the menu. The same happens if > I set the key equivalent to @"p", @"q" and some others, but equivalents like > @"

Re: Objective-C Instance Variable Names

2008-04-06 Thread Michael Ash
On Sun, Apr 6, 2008 at 7:50 PM, Jim Correia <[EMAIL PROTECTED]> wrote: > On Apr 6, 2008, at 7:39 PM, John Stiles wrote: > > > > You can't be KVC compliant if you use prefixes like m_, so this limits > your potential for using things like bindings. > > > > Yes and no. KVC doesn't care what the iVar

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
On 7 Apr 2008, at 01:16, Michael Ash wrote: In short, if your shortcut conflicts with an existing one then it won't show. But if it matches an existing one including in terms of behavior, then it will show. Yeah but that wasn't happening, my command-G shortcut was conflicting with the Find

NSTreeController KVO

2008-04-06 Thread Hamish Allan
Hi, I have an NSOutlineView bound to an NSTreeController, in turn bound to an NSMutableArray whose contents are: ( { children = ( { displayName = "child 1"; }, { displayName = "child 2"; } ); displayName = "parent"; } ) The bindings are set up as you might

Re: Scaling a window background image quickly

2008-04-06 Thread Ricky Sharp
On Apr 6, 2008, at 3:30 PM, Mike R. Manzano wrote: It's a shame there isn't a more lightweight technology than Illustrator/PDF that lets you easily draw vector UI elements in a graphical editor with your application's performance in mind. I create all my artwork with Illustrator and save

Re: Beginner reading, etc.

2008-04-06 Thread Adam Gerson
http://pmougin.wordpress.com/2008/03/26/become-an-xcoder-leopard-edition/ http://www.amazon.com/Cocoa-Programming-Mac-OS-X/dp/B000OZ0N94/ On Sun, Apr 6, 2008 at 7:01 PM, andy knasinski <[EMAIL PROTECTED]> wrote: > I searched the archives and found some old posts, but i'm wondering what > current

CoreAnimation and CIPerspectiveTransform

2008-04-06 Thread vance
I am trying to apply the CIPerspectiveTransform to a CoreAnimation Layer. But for some reason I am getting this debugger output and nothing gets displayed: CoreImage: ROI is not tilable: APPLY perspective DOD [118,140 528x367] ROI [258,296 22x24] RGBA_14 AFFINE [1 -0 -0 1 -16384 -16384] DO

Re: NSTreeController KVO

2008-04-06 Thread Chris Suter
On 07/04/2008, at 10:30 AM, Hamish Allan wrote: Hi, I have an NSOutlineView bound to an NSTreeController, in turn bound to an NSMutableArray whose contents are: [snip] Have you seen this:

Re: Objective-C Instance Variable Names

2008-04-06 Thread Jim Correia
On Apr 6, 2008, at 8:18 PM, Michael Ash wrote: Of course direct ivar access works with funny naming conventions. The keys obviously have to share the funny naming convention, but this is just mildly ugly, not any sort of showstopper. For proof, watch Interface Builder not grind to a halt when yo

Re: Objective-C Instance Variable Names

2008-04-06 Thread Kyle Sluder
On Sun, Apr 6, 2008 at 7:49 PM, Chris Suter <[EMAIL PROTECTED]> wrote: > I think you can be KVC compliant but you have to define setters and getters > for everything. Yes, but I've also experienced the odd issue with the IB unfreezing machinery. --Kyle Sluder

Re: Objective-C Instance Variable Names

2008-04-06 Thread John C. Randolph
On Apr 3, 2008, at 9:45 AM, Jens Alfke wrote: On 3 Apr '08, at 9:29 AM, Richard Somers wrote: There is a common practice of prefixing instance variable names with "_", a single underscore character. And it's a very good idea to do so, IMHO. Jens, That's an Apple internal coding conventi

Using existing SQLite database with core data?

2008-04-06 Thread Peter Zegelin
I have an existing database application that uses sqlite but was not created using Core Data. Is there any reasonable way to get core data to use an existing database and 'reverse engineer' the entities and relationships to create its model? thanks! Peter __

Problems with Split Views?

2008-04-06 Thread Peter Zegelin
I am quite new to Cocoa and have been experimenting with split views in Interface Builder. It's basically 3 vertical splits with each end view also split in half horizontally. It seems to do more or less what I want. However looking around for example projects I get the impression that the

[Moderator] Re: UIView animation

2008-04-06 Thread Scott Anguish
On Apr 6, 2008, at 5:17 PM, Benjamin BERTRAND wrote: Hi, I'm new to cocoa and have started to develop a board game for the iPhone. Discussion of iPhone SDK development is not allowed here. The SDK is covered by a Non-Disclosure Agreement. Thanks Scott (moderator) __

Re: Using existing SQLite database with core data?

2008-04-06 Thread Quincey Morris
On Apr 6, 2008, at 19:09, Peter Zegelin wrote: I have an existing database application that uses sqlite but was not created using Core Data. Is there any reasonable way to get core data to use an existing database and 'reverse engineer' the entities and relationships to create its model?

NSViewController's representedObject and NSArrayController's selection don't mix?

2008-04-06 Thread Jacob Lukas
I have a table of Core Data objects and a set of inspector views. Depending on the Class(es) of the selection in the table view, the set of inspector views changes. I managed the inspector views with NSViewControllers. The fields in the inspector view are bound to the view controller's re

Re: NSVector, CGVector Additions

2008-04-06 Thread Jens Alfke
On 6 Apr '08, at 11:59 AM, Stefan Hafeneger wrote: This is kind of a class Addition so the NS prefix should be okay. Nope. No one gets to make new identifiers with the NS prefix except Apple (in fact, only the AppKit/Foundation team inside Apple.) Doing otherwise defeats the purpose of hav

Re: Image Processing

2008-04-06 Thread Jens Alfke
On 6 Apr '08, at 1:40 PM, Lorenzo wrote: But when I ask for its size with NSSize imageSize = [sourceImage size]; I don’t get the real pixel size (1680 x 1050), but I get (504 x 315) The units of [NSImage size] are points, not pixels. If you read an NSImage from a file, it respects the DP

Re: Objective-C Instance Variable Names

2008-04-06 Thread Scott Andrew
You aren't supposed to EVER use direct ivar acess. Every document i have ever read regarding ObjectiveC has always said to define acessors. So what prefix you use on your ivars don't matter. To set m_object. I am going to either define get/set functions or use properties. This of course de

Re: Objective-C Instance Variable Names

2008-04-06 Thread Jens Alfke
On 6 Apr '08, at 9:17 PM, Scott Andrew wrote: You aren't supposed to EVER use direct ivar acess. Every document i have ever read regarding ObjectiveC has always said to define acessors. Ummm ... for access to another object's instance data, that's true. You should avoid the temptation t

Re: activate my application while dragging on other application window

2008-04-06 Thread Apparao Mulpuri
But, in my case its differ. Here i am setting window appearence attributes like transprent, size and move. I don't thing, there is security reasons in this If Apple provide any api to set/get windows appearence attributes. My application is primarily designed for maximum use of Monitor space. For

Re: Objective-C Instance Variable Names

2008-04-06 Thread Graham Cox
This is a very silly remark. Why would they laugh? Even if they did, do I care? No. I usually use mSomeVarName or m_someVarName in my projects for ivars. I like the 'm', it tells me it's a member. I also use s_ for statics and g_ for globals. I come from C++ to Cocoa, so what? Whatever conv

Re: Using existing SQLite database with core data?

2008-04-06 Thread Chris Hanson
On Apr 6, 2008, at 7:09 PM, Peter Zegelin wrote: I have an existing database application that uses sqlite but was not created using Core Data. Is there any reasonable way to get core data to use an existing database and 'reverse engineer' the entities and relationships to create its model?

Re: Using existing SQLite database with core data?

2008-04-06 Thread mmalc crawford
On Apr 6, 2008, at 7:35 PM, Quincey Morris wrote: On Apr 6, 2008, at 19:09, Peter Zegelin wrote: I have an existing database application that uses sqlite but was not created using Core Data. Is there any reasonable way to get core data to use an existing database and 'reverse engineer' the

ImageIO key properties

2008-04-06 Thread Mirko Viviani
Hi, for an application targeted for 10.4 I need to access the value of some key properties defined for 10.5 in CGImageProperties.h, like kCGImagePropertyExifAuxDictionary. Is there a legal way to do this? Thank you. Mirko ___ Cocoa-dev mailing li

Re: Objective-C Instance Variable Names

2008-04-06 Thread Todd Blanchard
Too late, I've been doing that since 1990 in C++. Seriously, I've yet to run into a problem with it and I have been doing it forever. Just don't be overly general with your variable names. Like I probably wouldn't use _window in a custom view subclass or anything. -Todd Blanchard On Ap

Re: Using existing SQLite database with core data?

2008-04-06 Thread Quincey Morris
On Apr 6, 2008, at 22:44, mmalc crawford wrote: The fact that Core Data is an object graph management and persistence framework does not in an of itself preclude it from reverse engineering an existing database. EOF is also an "object graph management and persistence framework" but it is