Re: Transparent image

2009-02-11 Thread Rob Keniger
On 11/02/2009, at 5:11 AM, Christian Graus wrote: Thanks - that's pretty much what I am going to do. I will move the objects that need transparency to NSImageView today, and then once we get this version out for demo purposes, I will start rewriting the tools I needed from IKImageView.

Binding to custom NSCell

2009-02-11 Thread Ken Tozier
Hi I created a custom NSCell subclass, defined accessors for stringValue, setStringValue, objectValue ane setObjectValue. I set the data cell for a column like so: [column setDataCell: customCell]; And bind the column to an array controller: [column bind: @value toObject: controller

ProcessInformationCopyDictionary

2009-02-11 Thread Trygve Inda
I call ProcessInformationCopyDictionary (psn, kProcessDictionaryIncludeAllInformationMask); but if the application has moved since it was launched, the result of this call in the CFBundleExecutable and BundlePath keys is wrong. The values contain the original location of the application. So...

Re: A Mac App helper NSStatusItem - how to share preferences

2009-02-11 Thread Trygve Inda
Steve Cronin (steve_cro...@mac.com) on 2008-12-28 8:41 PM said: I have an application which will have an optional helper NSStatusItem. The statusItem is a stand-alone application which can be installed as a LoginItem. I want this status item to be able to read the preferences file from

Re: ProcessInformationCopyDictionary

2009-02-11 Thread Jean-Daniel Dupas
Le 11 févr. 09 à 11:43, Trygve Inda a écrit : I call ProcessInformationCopyDictionary (psn, kProcessDictionaryIncludeAllInformationMask); but if the application has moved since it was launched, the result of this call in the CFBundleExecutable and BundlePath keys is wrong. The values

Re: ProcessInformationCopyDictionary

2009-02-11 Thread Trygve Inda
I think it exists a standard Apple Event to retrieve a process version. (get «vers») But you can also add a custom get version Apple Event handler to your helper and use it to retrieve the version from your pref pane. This works great for future versions, but not existing ones. I'll look

Re: ProcessInformationCopyDictionary

2009-02-11 Thread Trygve Inda
I think it exists a standard Apple Event to retrieve a process version. (get «vers») But you can also add a custom get version Apple Event handler to your helper and use it to retrieve the version from your pref pane. Hmmm... It seems keyAEVersion ('vers') only gets the version info for

Re: ProcessInformationCopyDictionary

2009-02-11 Thread Jean-Daniel Dupas
Le 11 févr. 09 à 12:54, Trygve Inda a écrit : I think it exists a standard Apple Event to retrieve a process version. (get «vers») But you can also add a custom get version Apple Event handler to your helper and use it to retrieve the version from your pref pane. Hmmm... It seems

Re: Possible to change value transformer for binding at runtime?

2009-02-11 Thread Keith Duncan
is there a way to change the value transformer used for a binding at runtime? You could write an NSProxy subclass to stand in for a given value transformer - register it instead of the actual value transformer. Then when you need to change the transformation grab it from the

Re: ProcessInformationCopyDictionary

2009-02-11 Thread Jean-Daniel Dupas
Le 11 févr. 09 à 12:46, Trygve Inda a écrit : I think it exists a standard Apple Event to retrieve a process version. (get «vers») But you can also add a custom get version Apple Event handler to your helper and use it to retrieve the version from your pref pane. This works great for

How resize a button or label to fit its content (at runtime)?

2009-02-11 Thread Oleg Krupnov
Is there a way to programmatically resize a button or text field to fit its contents exactly? I can do it in the Interface Builder, but I need to do it at runtime. Thanks! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Communication between objects

2009-02-11 Thread Clint Shryock
in order for modelObject1 to talk to modelObject2, it must have a reference to that object, similar to how myControllerObject has a reference to both modelObject1 and modelObject2 which you use to send messages. +Clint On Wed, Feb 11, 2009 at 8:42 AM, Jason Wiggins jwigg...@optusnet.com.auwrote:

Re: Communication between objects

2009-02-11 Thread I. Savant
Say I have myControllerObject. I alloc and init modelObject1 and also modelObject2. How do I access the ivars of modelObject1 from modelObject2 and vice versa? modelObject1 and modelObject 2 both exist somewhere in memory, so how do I get a pointer to or make a connection between these two

Re: How resize a button or label to fit its content (at runtime)?

2009-02-11 Thread I. Savant
On Wed, Feb 11, 2009 at 9:40 AM, Jon C. Munson II jmun...@his.com wrote: One other hint, when a keyword search doesn't return something of value, try looking at the class of interest and follow up the chain until you find, or not, what you seek. Sure, it is tedious, but often can resolve

RE: How resize a button or label to fit its content (at runtime)?

2009-02-11 Thread Jon C. Munson II
AppKiDo is indeed a very cool tool. Although I haven't used it overly much, I do appreciate its usefulness. Peace, Love, and Light, /s/ Jon C. Munson II -Original Message- From: I. Savant [mailto:idiotsavant2...@gmail.com] Sent: Wednesday, February 11, 2009 10:04 AM To:

Re: How resize a button or label to fit its content (at runtime)?

2009-02-11 Thread Andy Lee
On Feb 11, 2009, at 10:03 AM, I. Savant wrote: On Wed, Feb 11, 2009 at 9:40 AM, Jon C. Munson II jmun...@his.com wrote: One other hint, when a keyword search doesn't return something of value, try looking at the class of interest and follow up the chain until you find, or not, what you

Re: Communication between objects

2009-02-11 Thread Jason Wiggins
Hi Clint (and I.S.) Thanks for your replies. I understand MVC and am happy with that now that a few thoughts have been cleared for me (thanks I.S.). OK, I now understand that and object knows nothing about its parent. Cool. I thought that was the case, but I wasn't convinced. Now, I

Re: Communication between objects

2009-02-11 Thread I. Savant
On Wed, Feb 11, 2009 at 10:42 AM, Jason Wiggins jwigg...@optusnet.com.au wrote: I understand MVC ... Sorry, but I disagree. You've still got some concepts missing. :-) Now, I understand I need a pointer to the other object, but I am failing (in a BIG way) in understanding HOW to get it

RE: Communication between objects

2009-02-11 Thread Jon C. Munson II
You need a line of code in your controller object thus: [modelObject1 setModelObject2:modelObject2]; Then, in your object code, something like: - (void)setModelObject2:(ModelObject2 *)anObject { modelObject2 = anObject; } You will need to include

Re: Communication between objects

2009-02-11 Thread Ken Thomases
On Feb 11, 2009, at 9:42 AM, Jason Wiggins wrote: Now, I understand I need a pointer to the other object, but I am failing (in a BIG way) in understanding HOW to get it or create it. myControllerObject has a pointer to it's children because it knows about it because it created it. But if

Re: Communication between objects

2009-02-11 Thread Andy Lee
On Feb 11, 2009, at 10:42 AM, Jason Wiggins wrote: But if modelObject1 doesn't know modelObject2 even exists, how can I create a pointer to it? Where do I get this reference from? If you want modelObject1 to have an ivar that refers to modelObject2, the typical ways to make the connection

Re: A Mac App helper NSStatusItem - how to share preferences

2009-02-11 Thread Michael Ash
On Wed, Feb 11, 2009 at 5:55 AM, Trygve Inda cocoa...@xericdesign.com wrote: In my helper app I use: userDefaults = [[NSUserDefaults standardUserDefaults] persistentDomainForName:kMainAppIdent]; You just need to make sure there is no chance of the helper and the host writing at the same

Re: Communication between objects

2009-02-11 Thread Jason Wiggins
OK, now I *think* I've got a bit idea. What I've been trying to do is get an ivar from object1 into object2 *directly* without using the controller as a middleman Is it true that I have to set up properties (using Objc 2) to get and set the ivars *via* the controller? I just did that and got

Re: Communication between objects

2009-02-11 Thread David LeBer
On 11-Feb-09, at 11:14 AM, Jason Wiggins wrote: OK, now I *think* I've got a bit idea. What I've been trying to do is get an ivar from object1 into object2 *directly* without using the controller as a middleman Is it true that I have to set up properties (using Objc 2) to get and set the

Re: Which keyboard (barcode scanner) did the event come from?

2009-02-11 Thread Gerd Knops
On Feb 10, 2009, at 5:08 PM, Kevin Gessner wrote: On Feb 9, 2009, at 11:47 PM, Gerd Knops wrote: Assuming I have two identical USB keyboards (actually barcode scanners) connected to a mac, is there any way to tell which of them a keyboard event came from? [snip] Is there some way to,

Re: UIScrollView - photo viewer like usage

2009-02-11 Thread David Duncan
On Feb 10, 2009, at 9:09 PM, Daryl Thachuk wrote: Yes it is possible to do this with UIScrollView but only for a small amount of images. You eventually run out of memory on the device. The best way accomplish this task would be to use CALayers which will allow you to unload images when

RESEND: Cocoaheads Lake Forest (92630) meeting 2/11/2009 (tonight!) at 7 pm on Modeling a Game with the Cocoa Frameworks

2009-02-11 Thread Scott Ellsworth
(It appears this did not make it through - apologies if a second copy appears.) CocoaHeads Lake Forest will be meeting on the second Wednesday of the month. We will be meeting at our usual location, Orange County Public Library (El Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630

Paste with no Edit Menu

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

Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread Luke Evans
I've just found out that some code that seemed to be working fine doesn't do so under all circumstances. I have a to-many relationship (called 'elements') in a managed object ('parent'). In one spot in my code, there is a need to obtain and present all of the elements of the parent managed

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread I. Savant
On Wed, Feb 11, 2009 at 2:48 PM, Luke Evans l...@eversosoft.com wrote: The parent MO is defined with an 'elements' property (nominally an NSSet). How? What does this declaration look like in your classes? I assume you have at least one custom subclass of NSManagedObject specified (for your

Re: Running out of memory when adding CGImageRef-to-NSImage frames to QTMovie in NSOperation subclass

2009-02-11 Thread Michael Hanna
A follow-up for posterity. I use [NSImage -addRepresentation:] instead of -TIFFRepresentation and made the object life cycle local. The result in Instruments was that the object allocation graph(all objects still living), drew like how the stock market has been recently(up and down, indicating

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread Luke Evans
On 11-Feb-09, at 12:16 PM, I. Savant wrote: How? What does this declaration look like in your classes? I assume you have at least one custom subclass of NSManagedObject specified (for your Element entity), based on the code example you gave, but it's important to let us know *how* this is

NSPopupButton in NSTableView header?

2009-02-11 Thread Randall Meadows
Is it possible to put a custom view, in this case an NSPopupButton, in a specific column header of an NSTableView? I have a table with 3 columns, one of which displays a status for one of several user-selectable things that correspond to the rest of the data in that row. I currently have

Re: Transparent Image

2009-02-11 Thread Christian Graus
Please file a bug and request this functionality. OK - that would not have occurred to me at all. That works in the Mac world ? Awesome !! I've found plenty of Microsoft bugs, and I was even an MVP at the time, they always ignored me, or told me they were features ( and I found some MAJOR bugs

Re: NSPopupButton in NSTableView header?

2009-02-11 Thread Randall Meadows
And OF COURSE I find the answer not 10 seconds after pressing Send...NSTableColumn -setHeaderCell:. Silly me, I was looking in NSTableHeaderView. What was I thinking?! ;) On Feb 11, 2009, at 1:40 PM, Randall Meadows wrote: Is it possible to put a custom view, in this case an NSPopupButton,

Re: Saving a PDF Selection or converting it to an NSRange and back

2009-02-11 Thread John Calhoun
On Feb 11, 2009, at 12:44 PM, Keith Blount wrote: The subject line says it all, really, I need to save a PDFSelection between sessions in my program, but there seems no way of doing this. A similar question came up on these last year but there was no solution: To save a selection sapnning

Re: One Shot Windows: WARNING

2009-02-11 Thread Seth Willits
On Feb 10, 2009, at 9:12 PM, Michael Ash wrote: The behavior of non-one shot windows is obviously not clear. Forgive me for saying this, but this sounds a lot like the common newbie complaints about Cocoa memory management. It's more than memory management. For example, why does a

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread Luke Evans
The documentation (Core Data Programming Guide -- Managed Object Accessor Methods -- Custom To-Many Relationship Accessor Methods) spells out all the stipulations for custom to-many accessors and the code example is: @property NSSet *employees; ... without the readonly flag. I would not

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread I. Savant
On Feb 11, 2009, at 5:09 PM, Luke Evans wrote: Anyway, like you, I can't see how having a read-only flag on the wrapping property in my NSManagedObject subclass is going to affect how a to-many relationship is internally represented within NSManagedObject. Moreover, I reset the declaration

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread Luke Evans
Hmmm ... I do not have an answer for this. If nobody else can offer any insight, I'd file a bug. In fact, I'd file it anyway because this random substitution should not happen. Yeah, I guess someone with deep knowledge of the states that a Core Data to-many relationship can be in

Re: Transparent Image

2009-02-11 Thread Mike Abdullah
Don't get your hopes up too much, plenty of issues remain unsolved for looong periods of time. You want http://bugreport.apple.com On 11 Feb 2009, at 20:41, Christian Graus wrote: Please file a bug and request this functionality. OK - that would not have occurred to me at all. That works in

Re: Transparent Image

2009-02-11 Thread Christian Graus
Thank you. The number is *6578276.*https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/85/wo/n3gbesxSHOpLghGqW9p2I0/8.34 On Thu, Feb 12, 2009 at 9:57 AM, Kyle Sluder kyle.slu...@gmail.com wrote: http://bugreport.apple.com Then make sure to post the bug number here. --Kyle Sluder

Re: Transparent Image

2009-02-11 Thread Christian Graus
Yeah, I'm sure this is not going to come in time to solve the issue for my project, but still, it's nice to think that it may get addressed at some point. On Thu, Feb 12, 2009 at 10:17 AM, Mike Abdullah cocoa...@mikeabdullah.netwrote: Don't get your hopes up too much, plenty of issues remain

Re: Communication between objects

2009-02-11 Thread Graham Cox
On 12 Feb 2009, at 1:42 am, Jason Wiggins wrote: How do I access the ivars of modelObject1 from modelObject2 and vice versa? Others have had plenty of useful advice to give on the general question, but in your original, this stood out for me. The answer here is: YOU DON'T. ivar stands

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread I. Savant
On Feb 11, 2009, at 5:38 PM, Luke Evans wrote: Clearly, you wouldn't even notice the switcheroo if you were driving the relationship via a more generic collection-like interface (e.g. like using -count, using fast enumeration or other things that apply equally well to a range of concrete

Re: Communication between objects

2009-02-11 Thread I. Savant
On Feb 11, 2009, at 6:26 PM, Graham Cox wrote: It's important to understand this difference, which is why I'm harping on about it - terminology matters. I usually do harp on such things, but today I didn't have the heart. I'm busy, stressed, and hoping to avoid a flame-war from

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread Luke Evans
[[self valueForKeyPath:@parent.elements] allObjects] ... this should do the same thing with the expected result. If it does not, there is another problem with your code. ... and it's cold comfort to find that the behaviour is exactly the same. So, at least there isn't 'another' problem

Re: Core Data: right way to gather all elements of a to-many relationship?

2009-02-11 Thread I. Savant
On Feb 11, 2009, at 7:37 PM, Luke Evans wrote: ... and it's cold comfort to find that the behaviour is exactly the same. So, at least there isn't 'another' problem :-) Well, actually, I realize now that my statement was ambiguous. I meant that asking via -valueForKey: and providing the

Application Architecture or approach

2009-02-11 Thread Louis Demers
Hi, I currently have an application that talks to a single device over TCP/ IP. My user interface has lots of parameters and status variables. I use bindings all over the place. The device is represented a custom NSObject instantiated in my MainMenu.xib. The various GUI elements are using

Re: Application Architecture or approach

2009-02-11 Thread Kyle Sluder
On Wed, Feb 11, 2009 at 8:07 PM, Louis Demers louisdem...@mac.com wrote: Now, I need to rewrite the app so that it can talk to multiple devices. I want to use bindings and write as little code as possible 8-) I'm considering an NSDocument based Applications and using panels/palettes to

Re: Application Architecture or approach

2009-02-11 Thread Louis Demers
On 11-Feb-09, at 20:20 , Kyle Sluder wrote: On Wed, Feb 11, 2009 at 8:07 PM, Louis Demers louisdem...@mac.com wrote: Now, I need to rewrite the app so that it can talk to multiple devices. I want to use bindings and write as little code as possible 8-) I'm considering an NSDocument based

How to force a message to a overriding method from within an init method

2009-02-11 Thread João Varela
Hi all I am porting most of my C++ code into Objective C and at the moment I have this problem: In C++ to force a constructor to call a overriding method of a subclass I used pure virtual functions defined in an abstract (super) class. An example: class Foo { Foo();

Re: Application Architecture or approach

2009-02-11 Thread Kyle Sluder
Nothing about this requires you to use the NSDocument architecture. You would implement the palettes the same way as you would for a document-based app. I'm just wondering if it is appropriate for what you're trying to do. --Kyle Sluder ___ Cocoa-dev

Re: How to force a message to a overriding method from within an init method

2009-02-11 Thread Shawn Erickson
On Wed, Feb 11, 2009 at 5:31 PM, João Varela j.var...@clix.pt wrote: Hi all I am porting most of my C++ code into Objective C and at the moment I have this problem: In C++ to force a constructor to call a overriding method of a subclass I used pure virtual functions defined in an abstract

Re: How to force a message to a overriding method from within an init method

2009-02-11 Thread Graham Cox
On 12 Feb 2009, at 12:31 pm, João Varela wrote: Hi all I am porting most of my C++ code into Objective C and at the moment I have this problem: In C++ to force a constructor to call a overriding method of a subclass I used pure virtual functions defined in an abstract (super) class.

Re: How to force a message to a overriding method from within an init method

2009-02-11 Thread Erik Buck
Calling a subclass's overridden implementation of a superclass member function from within the super class constructor is very very dangerous in C++. I don't believe if is even supported by the ANSI/ ISO standard, and to the extent it works at all, it is probably compiler and linker

Re: Application Architecture or approach

2009-02-11 Thread Graham Cox
On 12 Feb 2009, at 12:27 pm, Louis Demers wrote: I Had not thought about plugins because all the devices are identical in capabilities. The devices are complex cameras. I wanted to have each cameras have it document window to display the specific video feed, but a single palette to

NSTextView and keyDown: in the responder chain

2009-02-11 Thread Tom
Hi everyone, From what I've read about [NSResponder keyDown], if the responder doesn't handle the event it should pass the event to [self nextResponder] or NSBeep() if it doesn't have a next responder. However, I've found that when an NSTextView receives a keyDown event that doesn't

Re: NSTextView and keyDown: in the responder chain

2009-02-11 Thread Graham Cox
On 12 Feb 2009, at 1:59 pm, Tom wrote: Is this a bug in NSTextView or am I missing something? Have you actually set the next responder of the field editor/text view? I think you have to actually do that explcitly (- setNextResponder:) --Graham

Re: NSTextView and keyDown: in the responder chain

2009-02-11 Thread Tom
On 12/02/2009, at 1:06 PM, Graham Cox wrote: On 12 Feb 2009, at 1:59 pm, Tom wrote: Is this a bug in NSTextView or am I missing something? Have you actually set the next responder of the field editor/text view? I think you have to actually do that explcitly (- setNextResponder:)

Re: Application Architecture or approach

2009-02-11 Thread Louis Demers
On 11-Feb-09, at 21:16 , Kyle Sluder wrote: Nothing about this requires you to use the NSDocument architecture. You would implement the palettes the same way as you would for a document-based app. and fundamentally, that is the part I do not know how and asked in a clumsy way 8-( I'm

Re: Application Architecture or approach

2009-02-11 Thread Louis Demers
On 11-Feb-09, at 21:30 , Graham Cox wrote: On 12 Feb 2009, at 12:27 pm, Louis Demers wrote: I Had not thought about plugins because all the devices are identical in capabilities. The devices are complex cameras. I wanted to have each cameras have it document window to display the

Re: Application Architecture or approach

2009-02-11 Thread Graham Cox
On 12 Feb 2009, at 3:04 pm, Louis Demers wrote: I do not care about sticking with that paradigm of one window per camera, but I'm conformable with that approach. But how to I get all the sliders and gui elements of my palettes to now bind to the object/camera that is selected. In my

Re: Application Architecture or approach

2009-02-11 Thread Louis Demers
On 11-Feb-09, at 23:11 , Graham Cox wrote: On 12 Feb 2009, at 3:04 pm, Louis Demers wrote: I do not care about sticking with that paradigm of one window per camera, but I'm conformable with that approach. But how to I get all the sliders and gui elements of my palettes to now bind to the

Re: Transparent Image

2009-02-11 Thread Michael Ash
On Wed, Feb 11, 2009 at 3:41 PM, Christian Graus christian.gr...@gmail.com wrote: Please file a bug and request this functionality. OK - that would not have occurred to me at all. That works in the Mac world ? Awesome !! I've found plenty of Microsoft bugs, and I was even an MVP at the time,

Re: Application Architecture or approach

2009-02-11 Thread Michael Ash
On Wed, Feb 11, 2009 at 11:29 PM, Louis Demers louisdem...@mac.com wrote: So the controller manages to reconnect the bindings to the selected objects. ! That would make sense. All that's left if to figure out the implementation details and coerce IB to do what I want. I'll try building a small

Re: Application Architecture or approach

2009-02-11 Thread Louis Demers
On 11-Feb-09, at 23:39 , Michael Ash wrote: Your window controller for the palette should then observe NSWindowDidBecomeMainNotification and update the NSObjectController's content pointer to point to the document corresponding to whatever window is currently the main window. Change that one

Re: Paste with no Edit Menu

2009-02-11 Thread Development Staff
You want to subclass NSWindow and override -sendEvent:, which will let you get at the keyboard events before the rest of the standard event handling stuff gets at it. You will use your subclass of NSWindow for your windows. Alternately you could subclass NSApp and override -sendEvent: