Re: List Running apps and windows

2008-05-05 Thread Jere Gmail
Well, finally solved. No need for AXIsProcessTrusted. The problem is that the data stored in the NSArray was comming from an CFArray and was not printed with NSLog. But it was there. I want to use the info to do something like witch. Thanks a lot for your tips. I'll post some code latter if

Flash'In'App – Free Cocoa Framework

2008-05-05 Thread Julia Rixon
http://www.eltima.com/products/cocoa-framework/ Flash'In'App is a free Cocoa framework that lets you load and fully manage Adobe® Flash movies directly from your own applications for Mac OS X. Flash'In'App is a set of several specific classes to manage and fully control all the aspects of

Trouble using NSMatrix with radiobuttons and using NSPopUp buttons

2008-05-05 Thread John Joyce
(sorry for the repost, I forgot to change the subject line before) I'm struggling and maybe tired, but how do you set the state of and NSMatrix with radio buttons and NSPopUpButton ? Does it go in windowDidLoad or should it be in awakeFromNIB ? This is in a Preference window for my app. I'm

How to convert UInt8 array to NSString

2008-05-05 Thread Marc Lohse
Hello, i am quite a newbie to objective-c and c and hence have to ask this certainly stupid newbie question. A C function that i'd like to use returns an array of UInt8 and i simply don't find out how to convert this into a NSString... Is there anybody willing to point me in the right

Accessing attributes of XML

2008-05-05 Thread Christian Graus
Hi, I have the following code: NSXMLDocument *doc = [[NSXMLDocument alloc] initWithContentsOfURL:xmlURL options:0 error:error]; NSXMLNode *node = [doc rootElement]; NSArray *array = [node nodesForXPath:@/DiaIndex/Item error:err]; int nodeCount = 0; while(nodeCount

Re: How to convert UInt8 array to NSString

2008-05-05 Thread Hank Heijink (Mailinglists)
+[NSString stringWithUTF8String:] is what you're looking for. I *think* UInt8 and char are always the same size, but I'm not 100% sure if you can always depend on that. If you can, you can just feed your UInt8 array to the function. Hope this helps, Hank On May 5, 2008, at 8:17 AM, Marc

Re: Flash'In'App – Free Cocoa Framework

2008-05-05 Thread Ferhat Ayaz
Why don't load flash via WebKit ? Ferhat On May 5, 2008, at 12:55 PM, Julia Rixon wrote: http://www.eltima.com/products/cocoa-framework/ Flash'In'App is a free Cocoa framework that lets you load and fully manage Adobe® Flash movies directly from your own applications for Mac OS X.

ScreenSaver.framework only 32-bit?

2008-05-05 Thread Steven Noonan
I realize 64-bit is merely a buzzword at this point, but it seems strange to me that the ScreenSaver framework is 32-bit only. I kind of guessed that if Apple was releasing Cocoa with 64-bit binaries, it would only make sense that -all- Cocoa frameworks (other than any deprecated ones)

Re: ScreenSaver.framework only 32-bit?

2008-05-05 Thread Jim Correia
On May 5, 2008, at 11:09 AM, Steven Noonan wrote: I realize 64-bit is merely a buzzword at this point, but it seems strange to me that the ScreenSaver framework is 32-bit only. I kind of guessed that if Apple was releasing Cocoa with 64-bit binaries, it would only make sense that -all-

Re: Trouble using NSMatrix with radiobuttons and using NSPopUp buttons

2008-05-05 Thread Graham Cox
Assign a tag to each individual cell and use -selectItemWithTag: G. On 5 May 2008, at 10:16 pm, John Joyce wrote: For the radio button matrix, I am totally lost and I don't understand how to set the state of it. Does the matrix need IBOutlets for each cell too?

Images in NSPopupMenu items when binded to a NSArrayController

2008-05-05 Thread Pierre Chatel
Hi List, I need to populate a an NSPopupMenu with items having both a title and an image attached. This NSPopupMenu is binded, via InterfaceBuilder, to an NSArrayController managing instances having both a title (NSString *) and image (NSImage *) property. Problem is, there is only one Content

Re: Updating NSTextView when it gets shorter [SOLVED]

2008-05-05 Thread Graham Cox
Um, thanks for that. Does this qualify as *less* roundabout than one notification? ;-) G. On 6 May 2008, at 12:44 am, Rob Petrovec wrote: I override setMinSize to always set it to some small size (like 11x11) no matter what the passed in size is. I also override setMaxSize to set

Re: How to convert UInt8 array to NSString

2008-05-05 Thread Jens Alfke
On 5 May '08, at 5:17 AM, Marc Lohse wrote: A C function that i'd like to use returns an array of UInt8 and i simply don't find out how to convert this into a NSString... It depends on what the encoding of the C string is. In the general case, use [NSString stringWithCString: ...

Re: Flash'In'App ? Free Cocoa Framework

2008-05-05 Thread Gordon Apple
Some of us want to incorporate Flash directly in our applications without WebKit. I've been in discussions with Eltima for awhile on this. The framework is free for personal use, but $399 (IMHO, not a bad price) for a commercial license. Unfortunately, you have to buy the commercial version

Re: Accessing attributes of XML

2008-05-05 Thread Jens Alfke
On 5 May '08, at 5:34 AM, Christian Graus wrote: NSXMLElement *node2 = [array objectAtIndex:nodeCount]; NSXMLElement *name = [node2 attributeForName:@Name]; 'name' should be declared as NSXMLNode*, or you'll get a compiler type- mismatch warning. (But that doesn't explain why its

Re: Images in NSPopupMenu items when binded to a NSArrayController

2008-05-05 Thread Hamish Allan
On Mon, May 5, 2008 at 5:03 PM, Pierre Chatel [EMAIL PROTECTED] wrote: So, what do you think is the best option for me to populate an NSPopupButton with text and images while still using cocoa bindings ? Have a look at what DragNDropOutlineView does for NSOutlineView (using ImageAndTextCell)

Saving as xml

2008-05-05 Thread John Joyce
What's the best method to save a document as xml? Should NSKeyedArchiver be doing this? My document and its objects are very simple, they can easily be nothing more than BOOLs and NSStrings (as keys). Other issue: If I have an NSDictionary (composed of two NSArrays' objects, keysArray,

Re: Saving as xml

2008-05-05 Thread Jens Alfke
On 5 May '08, at 10:45 AM, John Joyce wrote: What's the best method to save a document as xml? Should NSKeyedArchiver be doing this? My document and its objects are very simple, they can easily be nothing more than BOOLs and NSStrings (as keys). You can use either NSKeyedArchiver or

Re: Cocoa-dev Digest, Vol 5, Issue 730

2008-05-05 Thread Richard Wolf
Christian, It's just like I posted to Mr. Gecko. XQuery is your friend. XPath returns nodes, XQuery allows you to return values. An XQuery to return the text inside your DiaIndex/Items is simple ... it would look like this: let $result := ./DiaIndex/Item return $result Notice that

Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5

2008-05-05 Thread John Calhoun
On May 3, 2008, at 1:58 AM, Antonio Nunes wrote: They are not preserved. If you are saving data into your own file format you can can query the widgets at saving time and write them out explicitly. Then restore them when the file is read back in, after the PDF pages have been restored.

Is There a File Comparison Control Available?

2008-05-05 Thread Patrick Altman
Does anyone know if there is a control that I can use in my Cocoa application to provide side by side file comparison support similar to FileMerge? I would consider both controls for sale and that are open source. If none are readily available, then could someone point me in the

Mac OS X Developer needed!!!

2008-05-05 Thread Darren Tessitore
This is Darren Tessitore with Heynow Software. We currently have an urgent job requirement for our client to fill the position of Mac OS Developer located in Hackensack, NJ. Position: Mac OS Developer Job Location: Hackensack, NJ Contract: 3 Months (Possibility of Extension) Job

NSXMLDocument encoding

2008-05-05 Thread Robert Cerny
Hi folks, I use NSXMLDocument to parse web page content, which is in NSWindowsCP1250Encoding. However I don't get correctly encoded data from NSXMLNodes NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; NSData *webData = [NSURLConnection

method definition not in @implementation context

2008-05-05 Thread J. Todd Slack
Hi All, I am trying to get back into some Objective-C and I have gotten an error: fatal error: method definition not in @implementation context Can anyone tell me what this means? -Jason ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: method definition not in @implementation context

2008-05-05 Thread Shawn Erickson
On Mon, May 5, 2008 at 1:16 PM, J. Todd Slack [EMAIL PROTECTED] wrote: Hi All, I am trying to get back into some Objective-C and I have gotten an error: fatal error: method definition not in @implementation context Can anyone tell me what this means? Some.m file... @implementation

Re: method definition not in @implementation context

2008-05-05 Thread Kyle Sluder
On Mon, May 5, 2008 at 4:16 PM, J. Todd Slack [EMAIL PROTECTED] wrote: Can anyone tell me what this means? You put a method definition outside an @implementation block? All method definitions like -(void)foo:(id)bar have to be inside an @implementation ... @end block. --Kyle Sluder

Re: Saving as xml

2008-05-05 Thread Jean-Daniel Dupas
Le 5 mai 08 à 19:55, Jens Alfke a écrit : On 5 May '08, at 10:45 AM, John Joyce wrote: What's the best method to save a document as xml? Should NSKeyedArchiver be doing this? My document and its objects are very simple, they can easily be nothing more than BOOLs and NSStrings (as keys).

Re: NSXMLDocument encoding

2008-05-05 Thread Ricky Sharp
On May 5, 2008, at 2:53 PM, Robert Cerny wrote: I use NSXMLDocument to parse web page content, which is in NSWindowsCP1250Encoding. However I don't get correctly encoded data from NSXMLNodes NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; NSData *webData =

Re: method definition not in @implementation context

2008-05-05 Thread J. Todd Slack
Hi Kyle. I was forgetting to include Cocoa.h, for some reason... Sorry. -Jason On May 5, 2008, at 1:21 PM, Kyle Sluder wrote: On Mon, May 5, 2008 at 4:16 PM, J. Todd Slack [EMAIL PROTECTED] wrote: Can anyone tell me what this means? You put a method definition outside an @implementation

Re: NSXMLDocument encoding

2008-05-05 Thread Robert Cerny
On 5.5.2008, at 22:41, Ricky Sharp wrote: On May 5, 2008, at 2:53 PM, Robert Cerny wrote: I use NSXMLDocument to parse web page content, which is in NSWindowsCP1250Encoding. However I don't get correctly encoded data from NSXMLNodes NSURLRequest *req = [NSURLRequest

-draggingEntered: never gets called

2008-05-05 Thread Michael Gardner
I'm trying to implement drag drop in an NSView subclass. I made sure that the source returns NSDragOperationMove in - draggingSourceOperationMaskForLocal:, and that the destination calls - registerForDraggedTypes: with the same (custom) type that the source uses for the drag operation.

Is There a File Comparison Control Available?

2008-05-05 Thread Patrick Altman
Does anyone know if there is a control that I can use in my Cocoa application to provide side by side file comparison support similar to FileMerge? I would consider both controls for sale and that are open source. If none are readily available, then could someone point me in the

Re: NSXMLDocument encoding

2008-05-05 Thread Jens Alfke
On 5 May '08, at 12:53 PM, Robert Cerny wrote: doc = [[NSXMLDocument alloc] initWithData:webData options:NSXMLDocumentTidyHTML error:error]; Try using -initWithContentsOfURL: instead — then it can see the HTTP headers, which

Re: Is There a File Comparison Control Available?

2008-05-05 Thread Jens Alfke
On 5 May '08, at 12:33 PM, Patrick Altman wrote: Does anyone know if there is a control that I can use in my Cocoa application to provide side by side file comparison support similar to FileMerge? I would consider both controls for sale and that are open source. I don't know of any.

Re: -draggingEntered: never gets called

2008-05-05 Thread Stéphane Sudre
On May 5, 2008, at 11:02 PM, Michael Gardner wrote: I'm trying to implement drag drop in an NSView subclass. I made sure that the source returns NSDragOperationMove in - draggingSourceOperationMaskForLocal:, and that the destination calls -registerForDraggedTypes: with the same (custom)

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 2:28 AM, Jens Alfke [EMAIL PROTECTED] wrote: On 5 May '08, at 5:34 AM, Christian Graus wrote: NSXMLElement *node2 = [array objectAtIndex:nodeCount]; NSXMLElement *name = [node2 attributeForName:@Name]; 'name' should be declared as NSXMLNode*, or you'll get a

What do these errors mean?

2008-05-05 Thread David Springer
Folks, This is not strictly a cocoa-dev question, if there is a better list to ask this on, please point me in the right direction. I get a pile of linker warnings like this: ld: warning PLBmpBase::GetLineArray32() const has different visibility (2) in

Re: -draggingEntered: never gets called

2008-05-05 Thread Michael Gardner
The source implements -draggingSourceOperationMaskForLocal: and - mouseDown: (for initiating the drag). The destination implements -draggingEntered:, - prepareForDragOperation:, and -performDragOperation:. I checked the pasteboard's types list, and the result is as expected. For reference,

Re: NSXMLDocument encoding

2008-05-05 Thread Robert Cerny
Hi, On 5.5.2008, at 23:14, Jens Alfke wrote: On 5 May '08, at 12:53 PM, Robert Cerny wrote: doc = [[NSXMLDocument alloc] initWithData:webData options:NSXMLDocumentTidyHTML error:error]; Try using -initWithContentsOfURL:

I Never get 'self' in Obj-C

2008-05-05 Thread J. Todd Slack
Hi All, I have the following: statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain]; [statusItem setHighlightMode:YES]; [statusItem setTitle:[NSString stringWithFormat:@%C,0x260F]]; [statusItem setEnabled:YES]; [statusItem

Re: NSXMLDocument encoding

2008-05-05 Thread Ricky Sharp
On May 5, 2008, at 4:52 PM, Robert Cerny wrote: However I don't get correctly encoded data from NSXMLNodes Well, what *do* you get? Show us the data and what you expected. I get the data in us-ascii encoding. The accented characters are missing from output or changed to wrong letters

Re: I Never get 'self' in Obj-C

2008-05-05 Thread Corbin Dunn
On May 5, 2008, at 2:50 PM, J. Todd Slack wrote: Hi All, I have the following: statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain]; [statusItem setHighlightMode:YES]; [statusItem setTitle:[NSString stringWithFormat:@%C,0x260F]];

Re: I Never get 'self' in Obj-C

2008-05-05 Thread Steve Bird
On May 5, 2008, at 5:50 PM, J. Todd Slack wrote: Hi All, I have the following: statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain]; [statusItem setHighlightMode:YES]; [statusItem setTitle:[NSString

Re: Accessing attributes of XML

2008-05-05 Thread Jens Alfke
On 5 May '08, at 2:30 PM, Christian Graus wrote: As for NSMXLNode, I moved to NSXMLElement to get access to attributeForName, I was using NSXMLNode before that, still to no avail. No, I meant to change this line: NSXMLElement *name = [node2 attributeForName:@Name]; That should be

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 8:27 AM, Jens Alfke [EMAIL PROTECTED] wrote: On 5 May '08, at 2:30 PM, Christian Graus wrote: As for NSMXLNode, I moved to NSXMLElement to get access to attributeForName, I was using NSXMLNode before that, still to no avail. No, I meant to change this line:

Re: Accessing attributes of XML

2008-05-05 Thread Jens Alfke
On 5 May '08, at 3:36 PM, Christian Graus wrote: OK - thanks. I will try that. My reading had me thinking that NSXMLElement and NSXMLDocument are both derived from NSXMLNode, and that anyting bar the root was an NSXMLElement, with methods returning NSXMLNode as a base class to all

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 8:44 AM, Jens Alfke [EMAIL PROTECTED] wrote: On 5 May '08, at 3:36 PM, Christian Graus wrote: OK - thanks. I will try that. My reading had me thinking that NSXMLElement and NSXMLDocument are both derived from NSXMLNode, and that anyting bar the root was an

Re: Trouble using NSMatrix with radiobuttons and using NSPopUp buttons

2008-05-05 Thread Graham Cox
I made an error in my mail, it should have been - selectCellWithTag: (it was very late). But maybe you spotted that? Assuming that's not it, there must be something else wrong, as this works for me. Is the outlet to the NSMatrix actually set? Is it pointing to the right object? Is the

Re: I Never get 'self' in Obj-C

2008-05-05 Thread Michael Vannorsdel
Your approach is fine, just pass in a valid object for the target since self doesn't exist at that point. If you don't have an object you'll need to make an objc class and instantiate it to handle the events from the status item. On May 5, 2008, at 4:55 PM, J. Todd Slack wrote: OK, I

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 9:00 AM, David Wilson [EMAIL PROTECTED] wrote: On Mon, May 5, 2008 at 6:36 PM, Christian Graus [EMAIL PROTECTED] wrote: Yeah, that's where I found the docs. IMHO it's a real shame that a proper DOM implimentation is not available as standard. I am familiar with

Re: Cannot remove an observer ... because it is not registered as an observer.

2008-05-05 Thread Jack Repenning
On May 4, 2008, at 10:07 PM, Jens Alfke wrote: The usual cause of this is that you have a property that isn't KVO- compliant. Something accesses your 'foo' property and registers as an observer of that property, and also as an observer of the object that's the property's current value; you

Multiple controls in a table cell

2008-05-05 Thread Randall Meadows
Ok, so I have my table displaying a variety of controls in different rows, thanks to Leopard's new tableView:dataCellForTableColumn:row: method. Now, to throw a wrench into the works... One of the aforementioned control types is a NSSlider. This particular slider has a very wide range

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
Hi Jens I just wanted to let you know, I fixed my various changes as per your recommendations ( getting back to the code I started with ) and figured out how/where to use po, and sure enough, my code was working all along, I just expected the info I got when I hovered the mouse over a variable to

Re: Multiple controls in a table cell

2008-05-05 Thread Graham Cox
On 6 May 2008, at 9:16 am, Randall Meadows wrote: So what I'd like to do is put both an NSSlider and an NSTextField in a single table cell, but I'm failing to see how I might accomplish that. Anyone have any great ideas (FSDO great)? I guess you could subclass NSSliderCell and show the

Re: Multiple controls in a table cell

2008-05-05 Thread Louis Sinclair
Hi, There's a way to design a view (with whatever controls you want) in a nib file and put that into a table cell that we used in a project a while ago. I don't remember where we got it, but if you Google SubviewTableViewController or SubviewTableViewCell it should get you in the right

Re: Multiple controls in a table cell

2008-05-05 Thread j o a r
On May 5, 2008, at 4:46 PM, Hamish Allan wrote: I don't remember where we got it, but if you Google SubviewTableViewController or SubviewTableViewCell it should get you in the right direction. It's by Joar Wingfors: http://joar.com/code/ On Leopard you can often use NSCollectionView

Re: I Never get 'self' in Obj-C

2008-05-05 Thread Bill Cheeseman
on 2008-05-05 6:55 PM, J. Todd Slack at [EMAIL PROTECTED] wrote: Does anyone have an example of how to put Obj-C (like an NSStatusItem) in with C? When you implement a function outside of an Objective-C class, but you want the function to have access to things that are inside the class, you

Re: Accessing attributes of XML (Christian Graus)

2008-05-05 Thread Richard Wolf
On May 5, 2008, at 6:49 PM, [EMAIL PROTECTED] wrote: I had to pick up the XPath stuff recently for a project I was working on, and I've got to say that once you get yourself thinking in that way, it's really very nice for inspecting XML files, giving you great, readable control for grabbing

Re: Accessing attributes of XML (Christian Graus)

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 10:55 AM, Richard Wolf [EMAIL PROTECTED] wrote: On May 5, 2008, at 6:49 PM, [EMAIL PROTECTED] wrote: I had to pick up the XPath stuff recently for a project I was working on, and I've got to say that once you get yourself thinking in that way, it's really very

Re: Cached text output is flippin' flipped!

2008-05-05 Thread Aki Inoue
Graham, All is well when I'm drawing directly to the real screen, but at certain times I cache my output offscreen in an NSPDFImageRep and/or a CGLayer. In both cases the text output gets inverted on a per-line basis - i.e. the whole block is the right way up but each line is

Re: Cached text output is flippin' flipped!

2008-05-05 Thread Graham Cox
On 6 May 2008, at 11:09 am, Aki Inoue wrote: NSLayoutManager expects that the coordinate system its rendering into to be flipped and the current graphics context's -isFlipped to return YES. I thought that was the case. How are you rendering into these contexts ? The contexts are

Re: Updating NSTextView when it gets shorter [SOLVED]

2008-05-05 Thread Rob Petrovec
IMO, yes. Its also cleaner, less error prone, and handles the view increasing and decreasing as needed to fit the text. The view also handles its own resizing as apposed to a secondary view doing it. So you can re-use the view and its code alot easier. --Rob On May 5, 2008, at 9:04

NSNumberFormatter behavior

2008-05-05 Thread Chataka
Hello, My app has a NSTextField on a UI window to accept user input and to display a NSNumber in a model object. The NSTextField and the NSNumber are bound using Cocoa Bindings, and the NSTextField is set a NSNumberFormatter. It is a very simple UI but I have two problems regarding this

Re: Cached text output is flippin' flipped!

2008-05-05 Thread Graham Cox
OK, I made some progress. In the case of the CGLayer backing, I have got the problem sorted - in fact passing YES for flipped when creating the NSGraphicsContext was all that was needed. I still have the same problem with my NSPDFImageRep though. In this case I want to make a

RE: Threading - How its done?

2008-05-05 Thread Karl von Moller
Hi to all, I have been working on a simple application that lists all available PDF's in the Users Documents Folder. I want to fill a Table view with only PDF's that exist at that location. When the User selects one of the PDF files (by highlighting it in the Table View) it is

Re: Threading - How its done?

2008-05-05 Thread John Calhoun
On May 5, 2008, at 7:17 PM, Karl von Moller wrote: -(void)openPDFandCreatePreview:(id)sender { //[progressOutlet setUsesThreadedAnimation:YES]; NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; [progressOutlet startAnimation:nil]; NSPDFImageRep *pdfRep;

Re: Cannot Remove Observer Error [The Quest Continues]

2008-05-05 Thread umjames
Thaddeus, Could it be that your array controller is set to automatically prepare content? I was having this problem when I saw this in the archives. I was able to solve it by turning of the prepares content checkbox in IB (or calling [NSArrayController setAutomaticallyPreparesContent: NO]).

Re: Cached text output is flippin' flipped! [SOLVED]

2008-05-05 Thread Graham Cox
Well that's certainly a solution, works well now. Thanks for your help, G. On 6 May 2008, at 11:43 am, Graham Cox wrote: I guess I could try drawing it (un)flipped using a transform - I'll give that a go. ___ Cocoa-dev mailing list

Re: Threading - How its done?

2008-05-05 Thread Michael Vannorsdel
It's usually unsafe to interact with UI objects from other threads. For instance with your image well, it may be in the middle of laying out and drawing its image in the main thread when a secondary thread suddenly changes the image in the middle of drawing. This can cause all kinds of

Re: Threading - How its done?

2008-05-05 Thread Karl von Moller
Many thanks for your reply on this - much appreciated. I did think it had something to do with the images being swapped out as often the crashes occurred as I quickly changed selection in the table view. Because I know nothing about threading, I resorted to anything to lock the threads.

Re: Threading - How its done?

2008-05-05 Thread Michael Vannorsdel
Locks are used as flow gates to keep two threads from interacting with the same shared data at the same time. For instance if you're adding objects to an array and at the same time another thread is doing the same, it will damage the array as neither thread knows someone else is modifying