Re: Trying to achieve aperture PopUp buttons

2010-03-03 Thread Gustavo Pizano
Hello Sean. I checked brandos framework, its impressive what he did, but unfortunately the menu its still aqua not lack, I will try asking a radar.. Regards Gustavo On Mar 2, 2010, at 10:49 PM, Sean McBride wrote: > On 3/2/10 9:28 PM, Gustavo Pizano said: > >> Have somebody used aperture? w

NSBezierPath EXC_BAD_ACCESS issues.

2010-03-03 Thread Billy Flatman
Hi all, I have a shape class containing an attribute: NSBezierPath *path; initialisation: path = [[NSBezierPath alloc] init]; [self setBezierPath]; setBezierPath: path = [NSBezierPath bezierPath]; then add the paths and close path. paint: [path setLineWidth: 1]; [path fill]; It all worked w

Re: NSBezierPath EXC_BAD_ACCESS issues.

2010-03-03 Thread Graham Cox
Your setBezierPath method is making a new, autoreleased path, it isn't using the one you created at initialisation. That is then autoreleased leaving stale, hence the crash. You're also leaking the first path you made. If setBezierPath is there to simply set up the bezier path, it shouldn't mak

Re: NSBezierPath EXC_BAD_ACCESS issues.

2010-03-03 Thread Billy Flatman
Hi Graham, Thanks for your help, I've implemented your suggestions and it's working great, I just have one quick question if you don't mind. I'm new to Objective-C as you've probably gathered and am not 100% about how the memory management works. Will I be causing a memory leek with the line: p

Re: NSBezierPath EXC_BAD_ACCESS issues.

2010-03-03 Thread Graham Cox
On 04/03/2010, at 12:14 AM, Billy Flatman wrote: > I'm new to Objective-C as you've probably gathered and am not 100% about how > the memory management works. Will I be causing a memory leek with the line: > path = [[NSBezierPath alloc] bezierPath]; > within my initialiseBezierPath method? >

Re: How a window was closed?

2010-03-03 Thread Eric Gorr
On Mar 2, 2010, at 6:39 PM, Mike Abdullah wrote: > > On 2 Mar 2010, at 23:32, Eric Gorr wrote: > >> Is there any way to determine how a window was closed? >> >> I need to base what I do on whether or not a window will be closed by the >> user pressing the close (red) button or some other way.

Help Book Icon in Xcode 3.2

2010-03-03 Thread Gabriel Fernandez
How do you specify the Help Book Icon in Xcode 3.2? Gabriel Fernandez Wheel Software ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderato

Re: How a window was closed?

2010-03-03 Thread Eric Gorr
On Mar 2, 2010, at 6:42 PM, Jens Alfke wrote: > > On Mar 2, 2010, at 3:32 PM, Eric Gorr wrote: > >> Is there any way to determine how a window was closed? >> I need to base what I do on whether or not a window will be closed by the >> user pressing the close (red) button or some other way. >

Re: NSXMLDocument and threads

2010-03-03 Thread Jeff Johnson
On Mar 3, 2010, at 12:56 AM, Jens Alfke wrote: > On Mar 2, 2010, at 10:18 PM, Jeff Johnson wrote: > >> Thus, Apple's documentation gives every reason to believe that it is safe to >> use NSXMLDocument off the main thread, but libxml's documentation gives >> every reason to believe that it is no

Re: How a window was closed?

2010-03-03 Thread Eric Gorr
On Mar 3, 2010, at 10:20 AM, Eric Gorr wrote: > > On Mar 2, 2010, at 6:42 PM, Jens Alfke wrote: > >> >> On Mar 2, 2010, at 3:32 PM, Eric Gorr wrote: >> >>> Is there any way to determine how a window was closed? >>> I need to base what I do on whether or not a window will be closed by the >>>

Re: How a window was closed?

2010-03-03 Thread Glenn L. Austin
On Mar 3, 2010, at 7:20 AM, Eric Gorr wrote: > > On Mar 2, 2010, at 6:42 PM, Jens Alfke wrote: > >> >> On Mar 2, 2010, at 3:32 PM, Eric Gorr wrote: >> >>> Is there any way to determine how a window was closed? >>> I need to base what I do on whether or not a window will be closed by the >>> u

Re: How a window was closed?

2010-03-03 Thread Eric Gorr
On Mar 3, 2010, at 10:41 AM, Glenn L. Austin wrote: > On Mar 3, 2010, at 7:20 AM, Eric Gorr wrote: > >> >> On Mar 2, 2010, at 6:42 PM, Jens Alfke wrote: >> >>> >>> On Mar 2, 2010, at 3:32 PM, Eric Gorr wrote: >>> Is there any way to determine how a window was closed? I need to base

Messaging Cocoa apps through Terminal

2010-03-03 Thread Ulai Beekam
How can I send messages to my Cocoa app through the terminal? Say something like MyGreatMp3Player.app --sendAdvancedMessageThatIsNotInTheUI create100EmptyPlaylists I suppose it's hard to do this on the .app since it's just a directory, but you get the point. Just so the user (but mainly the deve

Re: Messaging Cocoa apps through Terminal

2010-03-03 Thread Ken Thomases
On Mar 3, 2010, at 10:17 AM, Ulai Beekam wrote: > How can I send messages to my Cocoa app through the terminal? Say something > like > MyGreatMp3Player.app --sendAdvancedMessageThatIsNotInTheUI > create100EmptyPlaylists > I suppose it's hard to do this on the .app since it's just a directory, bu

Re: Trying to achieve aperture PopUp buttons

2010-03-03 Thread Sean McBride
On 3/3/10 10:10 AM, Gustavo Pizano said: >Hello Sean. I checked brandos framework, its impressive what he did, but >unfortunately the menu its still aqua not lack, I will try asking a radar.. I agree BWToolKit is impressive, and so if he failed to do it, I suspect it's pretty hard. Perhaps you

Re: How a window was closed?

2010-03-03 Thread Jens Alfke
On Mar 3, 2010, at 7:20 AM, Eric Gorr wrote: >> Otherwise, you can make your class implement the NSWindow delegate method >> -windowShouldClose:, which will also be called when the user tries to close >> the window. > > This method is called after I press the close (red) button. My only conce

Re: running javascript from obj-C

2010-03-03 Thread Jens Alfke
On Mar 2, 2010, at 4:14 PM, Russell Gray wrote: > And I was thinking of taking the approach, of feeding a javascript function > to Safari: > > function hide_elements(id) > { > document.getElementById(id).style.display="none"; > } You can do the same thing by calling the DOM API from Objective-

Re: How a window was closed?

2010-03-03 Thread Eric Gorr
On Mar 3, 2010, at 11:43 AM, Jens Alfke wrote: > > On Mar 3, 2010, at 7:20 AM, Eric Gorr wrote: > >>> Otherwise, you can make your class implement the NSWindow delegate method >>> -windowShouldClose:, which will also be called when the user tries to close >>> the window. >> >> This method i

Re: Messaging Cocoa apps through Terminal

2010-03-03 Thread has
Ulai Beekam wrote: > How can I send messages to my Cocoa app through the terminal? Say something > like > MyGreatMp3Player.app --sendAdvancedMessageThatIsNotInTheUI > create100EmptyPlaylists I think the simplest way would be to write yourself a simple command line tool that uses Distributed Ob

Re: Help Book Icon in Xcode 3.2

2010-03-03 Thread Kyle Sluder
On Wed, Mar 3, 2010 at 7:18 AM, Gabriel Fernandez wrote: > How do you specify the Help Book Icon in Xcode 3.2? This is cocoa-dev. If you have Xcode questions, they belong on xcode-users. If you have help questions, they belong on apple-help-authoring. Or you could just read the documentation. htt

Arrow keys not working in NSTabView

2010-03-03 Thread David Alter
I have dynamically created a NSTabView and added NSTabViewItems to it. It works with the exception of if the NSTabView has the focus I can not use the right and left arrow keys to navigate to the other tabs. The arrow keys work if I create the tab view with IB. I'm not sure what is different. I sus

Re: Help Book Icon in Xcode 3.2

2010-03-03 Thread Matt Neuburg
On Wed, 3 Mar 2010 10:18:43 -0500, Gabriel Fernandez said: >How do you specify the Help Book Icon in Xcode 3.2? Did you read the docs? Search at Apple's site for "help book icon". m. -- matt neuburg, phd = m...@tidbits.com, A fool + a tool + an autorelease pool =

xcode-debug style toolbar above editor area

2010-03-03 Thread Mazen M. Abdel-Rahman
Hi All, Thanks to everyone for helping me with my previous question. I had another one though. When in a debugging session in xcode - but not in the main debug view - a small "toolbar" appears above the editor. In my case it's between the editor and the the file name list, and contains debug

Re: Help Book Icon in Xcode 3.2

2010-03-03 Thread Kyle Sluder
On Mar 3, 2010, at 10:34 AM, Gabriel Fernandez wrote: why don't YOU read that documentation and try it out? I wouldn't have asked if I didn't already search the archives, and oh yeah, forgot about GOOGLE! Smart-guy. You made no indication that you had tried anything at all. If you can'

Re: Messaging Cocoa apps through Terminal

2010-03-03 Thread Matt Neuburg
On Wed, 3 Mar 2010 16:17:13 +, Ulai Beekam said: >get the point. Just so the user (but mainly the developer for testing purposes) >can somehow make the app do things that cannot be done in the UI. This might be a reason to build some scriptability (AppleScript-type) into the app. In fact, it

Re: running javascript from obj-C

2010-03-03 Thread Matt Neuburg
On Wed, 3 Mar 2010 11:14:01 +1100, Russell Gray said: >What I was wanting to know, is how do I apply the javascript to Safari? Safari implements an AppleScript command "do JavaScript". So you can do this by sending Safari an Apple event. Operators are waiting to take your call. :) m. -- matt ne

Re: Trying to achieve aperture PopUp buttons

2010-03-03 Thread Gustavo Pizano
Hehehe,.. Im not that expert, when he has done its quite a nice expertise I wish I can reach in the mid term, so far, I will keep subclassing what I can and give my apps the proper Look and feel, depending on reqs. G. On Mar 3, 2010, at 5:39 PM, Sean McBride wrote: > On 3/3/10 10:10 AM, Gustav

Re: running javascript from obj-C

2010-03-03 Thread Ryan Wilcox
On 3/3/10 at 7:14 PM, sweetpproducti...@gmail.com (Russell Gray) wrote: And I was thinking of taking the approach, of feeding a javascript function to Safari: function hide_elements(id) {
document.getElementById(id).style.display="none";
 } where id would be fed to the script from the adblock

Uninitialized rectangle??

2010-03-03 Thread fabian
Hi, I once noticed that this code caused an assertion failure when placed in awakeFromNib. NSStatusBar *statusBar = [NSStatusBar systemStatusBar]; statusItem = [[statusBar statusItemWithLength:26] retain]; NSRect frameRect = [[statusItem view] frame]; MyStatusItemView *theView = [[MyStatusItemVie

Re: Uninitialized rectangle??

2010-03-03 Thread Steven Degutis
In this line: NSRect frameRect = [[statusItem view] frame]; the method -view is returning nil, and thus so is -frame, which means frameRect contains garbage (or NSZeroRect if you're lucky). Create a dummy view and give it to the status item before asking for the frame. Keep in mind, you will onl

Re: Uninitialized rectangle??

2010-03-03 Thread Ken Thomases
On Mar 3, 2010, at 1:23 PM, fabian wrote: > I once noticed that this code caused an assertion failure when placed > in awakeFromNib. > > NSStatusBar *statusBar = [NSStatusBar systemStatusBar]; > statusItem = [[statusBar statusItemWithLength:26] retain]; > NSRect frameRect = [[statusItem view] fra

Re: xcode-debug style toolbar above editor area

2010-03-03 Thread Abhinay Kartik Reddyreddy
Look for NSToolbar in Interface Builder... On Mar 3, 2010, at 2:01 PM, Mazen M. Abdel-Rahman wrote: > Hi All, > > Thanks to everyone for helping me with my previous question. I had another > one though. > > When in a debugging session in xcode - but not in the main debug view - a > smal

Uninitialized rectangle??

2010-03-03 Thread slasktrattena...@gmail.com
Hi, I once noticed that this code caused an assertion failure when placed in awakeFromNib. NSStatusBar *statusBar = [NSStatusBar systemStatusBar]; statusItem = [[statusBar statusItemWithLength:26] retain]; NSRect frameRect = [[statusItem view] frame]; MyStatusItemView *theView = [[MyStatusItemVie

NSBrowser + Core Data Woes

2010-03-03 Thread Karl Moskowski
I'm manually populating an in-memory CD store with a hierarchy of objects and binding them to a NSBrowser via a NSTreeController. Everything displays fine, but now I'm trying to get at the underlying managed object; I use a custom NSBrowserCell that has a checkbox next to the name, and the MO ha

Re: xcode-debug style toolbar above editor area

2010-03-03 Thread Mazen M. Abdel-Rahman
Thanks for the quick reply. My understanding was that NSToolBar is specifically meant for windows - i.e. it would get attached to an NSWindow. The "tool bar" I am referring to in xcode is either a view or attached to a view - and not to a window. At least that's what it seems like to me. Tha

Re: How a window was closed?

2010-03-03 Thread Graham Cox
On 04/03/2010, at 3:50 AM, Eric Gorr wrote: > Unfortunately, that knowledge won't help me solve the problem in front of me But it might help if you told us what the problem in front of you actually was. A simple and obvious solution might then become clear. > nor would I be able to do anythin

Returning a useful error from NSDocument's -readFromURL:...

2010-03-03 Thread Keith Blount
Hello, Okay, I know this comes up a lot, but I can't find a single page with a satisfactory solution. Please feel free to post nothing but a link with the solution if I have missed the bloomin’ obvious, of course - this question has been asked here before and in other places, and it seems as th

Re: How a window was closed?

2010-03-03 Thread Scott Ribe
> However, this did not seem to work as I might have expected. My window > controller no longer receives the window will close notification, for example. You're taking over the close button's responsibilities, but not doing everything it does. Start with: NSButton *b = [[self window] standar

Re: Uninitialized rectangle??

2010-03-03 Thread fabian
Thanks for your replies. I understand that the -frame message is returning garbage. What I don't understand is why statusBar, statusItem or the statusItem's view is nil during (but not after) the unarchiving of the nib, or (on 10.5.8) even shortly after NSApp is fully loaded. Or is it? If I can't k

Re: How a window was closed?

2010-03-03 Thread Ken Ferry
On Wed, Mar 3, 2010 at 8:50 AM, Eric Gorr wrote: > > >> So, how certain is it that it will _only_ be called if the user presses > the close (red) button? > > > > It's also called if the user chooses the Close menu command or presses > Cmd-W. > > Good to know. You should also consider AppleScrip

Re: Uninitialized rectangle??

2010-03-03 Thread Jens Alfke
On Mar 3, 2010, at 3:00 PM, fabian wrote: Thanks for your replies. I understand that the -frame message is returning garbage. What I don't understand is why statusBar, statusItem or the statusItem's view is nil during (but not after) the unarchiving of the nib, or (on 10.5.8) even shortly

Uninitialized rectangle??

2010-03-03 Thread slasktrattena...@gmail.com
Hi, I once noticed that this code caused an assertion failure when placed in awakeFromNib. NSStatusBar *statusBar = [NSStatusBar systemStatusBar]; statusItem = [[statusBar statusItemWithLength:26] retain]; NSRect frameRect = [[statusItem view] frame]; MyStatusItemView *theView = [[MyStatusItemVie

Click in Table

2010-03-03 Thread David Blanton
I have a window with an NSComboBox and anNSTableView When first displayed the NSComboBox has focus When I click in the NSTableView the NSComboBox action is called followed by should select row and selection changed delegate methods for the table being called This does not seem correct to m

Re: Click in Table

2010-03-03 Thread Fritz Anderson
On 3 Mar 2010, at 7:06 PM, David Blanton wrote: > When first displayed the NSComboBox has focus > > When I click in the NSTableView the NSComboBox action is called followed by > should select row and selection changed delegate methods for the table being > called > > This does not seem correct

Re: Click in Table [More Pilot Error]

2010-03-03 Thread David Blanton
The NSComBox was 'selectable' and 'editable' turned that off and behaviour is correct On Mar 3, 2010, at 6:06 PM, David Blanton wrote: I have a window with an NSComboBox and anNSTableView When first displayed the NSComboBox has focus When I click in the NSTableView the NSComboBox action is

Responding to kill signals with the run loop

2010-03-03 Thread Jamie Hardt
Is there a straightforward way, or a way through the Cocoa API, to treat signals like SIGTERM and SIGHUP as run loop sources and to handle them as events in the run loop? Right now I install signal handlers during initialization and these just set flags that are tested on every spin thru the r

Re: Responding to kill signals with the run loop

2010-03-03 Thread Dave Keck
This can be done using kevents. See the InstallHandleSIGTERMFromRunLoop function, here: http://developer.apple.com/mac/library/samplecode/PreLoginAgents/listing2.html ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Debugging problem

2010-03-03 Thread Laurent Daudelin
I'm trying to debug a problem where an NSOutlineView, as part of a drag, tries to create an instance of NSURL using "- (id)initWithString:(NSString *)URLString relativeToURL:(NSURL *)baseURL" with a nil string and get the following error: *** Ignoring exception 'NSInvalidArgumentException' (rea

Re: Responding to kill signals with the run loop

2010-03-03 Thread Ken Ferry
In 10.6 you can also do this by setting a dispatch queue on which you want a block invoked when a signal comes in. If you give it the main dispatch queue, that's like installing on the runloop of the main thread. See . This is also nice because it's in _addition_ to signal handlers, not a replac

NSImageRep simple code

2010-03-03 Thread Martin Beroiz
Hello everyone, I'm trying to understand how NSImageRep works, so I read the docs and came up with this simple code that seems to... do something. I'm confused about what's actually doing, I only see a big black block in my custom view. My intention is to make a 2x2 pixels image with differe

Re: Responding to kill signals with the run loop

2010-03-03 Thread Jamie Hardt
Thanks! On Mar 3, 2010, at 7:28 PM, Ken Ferry wrote: > In 10.6 you can also do this by setting a dispatch queue on which you want a > block invoked when a signal comes in. If you give it the main dispatch > queue, that's like installing on the runloop of the main thread. > > See . > > This

Re: NSImageRep simple code

2010-03-03 Thread Graham Cox
On 04/03/2010, at 3:54 PM, Martin Beroiz wrote: > bitsPerSample:8 > pixels[0] = 1; > pixels[1] = 0; > pixels[2] = 0; > pixels[3] = 0; > The docs say that NSDeviceWhiteColorSpace has pure white at 1.0, so I'm > guessing that pixels[0] = 1

Sorting contents of an NSCollectionView

2010-03-03 Thread Eli Bach
I have a core-data app, with a view that shows a managed object, along with an NSCollectionView displaying related managed objects in 1 column, all hooked together primarily with bindings. This works fine (selecting different objects automatically updates the collectionview and I can add/edit/d

Re: NSImageRep simple code

2010-03-03 Thread Martin Beroiz
Oh, thanks! I was missing that, now it works ok. I'll keep playing with this toy code. M. On Mar 3, 2010, at 11:02 PM, Graham Cox wrote: > > On 04/03/2010, at 3:54 PM, Martin Beroiz wrote: > >> bitsPerSample:8 > >> pixels[0] = 1; >> pixels[1] = 0; >> p

Core Data: UITableView moveRowAtIndexPath

2010-03-03 Thread PCWiz
I have an iPhone app and I'm trying to implement table row reordering and to still have it work with Core Data. Here's my code: - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { if (fromIndexPath.section =

Re: Returning a useful error from NSDocument's -readFromURL:...

2010-03-03 Thread Jerry Krinock
On 2010 Mar 03, at 13:52, Keith Blount wrote: > So, here is my error-setting: Assuming this code is in your -readFromURL:ofType:error: implementation, it looks OK to me, except that I'd suggest you give that error a nonempty domain and a nonzero code. For the former, [[NSBundle mainBundle]

Re: Returning a useful error from NSDocument's -readFromURL:...

2010-03-03 Thread Charles Srstka
On Mar 3, 2010, at 11:41 PM, Jerry Krinock wrote: >> I could put all of the information into NSLocalizedDescriptionKey, but this >> looks horrible as it’s all in bold > > Ah, yes. That's another reason why I don't use Cocoa's error presentation. > I hate that boldface crap. What’s wrong with

Re: Debugging problem

2010-03-03 Thread Laurent Cerveau
Did you try to break on -[NSException raise] or on the NSURL initWithString method? Laurent Sent from my road phone On Mar 4, 2010, at 4:24 AM, Laurent Daudelin wrote: I'm trying to debug a problem where an NSOutlineView, as part of a drag, tries to create an instance of NSURL using "

Re: Debugging problem

2010-03-03 Thread Laurent Daudelin
I tried setting a breakpoint on [NSException raise]. Didn't try on the [NSURL initWithString:baseURL:] but I'll try it tomorrow. Maybe that will help. -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://nemesys.dyndns.org Logiciels Nemesys Softwa