SMS Application

2010-04-23 Thread Angelica Grace Tanchico

Hello,

Is it possible to integrate iPhone's SMS application to a new application?
Not just launching the SMS app (and terminating the calling app) but 
some kind of SMS as a tab view on a new app?


Thanks in advance! :)
Angie
  
_
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Wave form graph through Core Audio?

2010-04-23 Thread Paul Sanders
 I'm working on generating a wave form for a sound bite, but I'm stuck in Core 
 Audio, which seems
 to be not over-documented, so to speak. All I need for now is an array of 
 integers, based on some
 sample rate, for a given sound file, but most of Core Audio seems to target 
 more complex functionality.
 Are there any code snippets around for sampling a sound file?

Apart from this being the wrong list as already mentioned, you are looking for 
ExtAudioFile.  This can read a variety of sound file formats and is very easy 
to use.

Paul Sanders.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Any way to manually fix NSTextView's font rendering bug?

2010-04-23 Thread Keith Blount
Hello,

I'm looking for a way to fix a minor but unsightly bug in NSTextView (I've 
reported it as bug ID 7898471, but it may be the same bug as an older one with 
ID 6987764). It's a bug that seems to have been present since Tiger, so I'd 
like to find a solution myself rather than wait and hope it gets fixed. :) The 
bug is simply that when drawing certain fonts, NSTextView clips their ascenders 
or descenders, apparently because the ascender or descender cannot all be 
contained in the current line fragment. If you'd like to see it for yourself, 
it's pretty easy to reproduce:

1) Open TextEdit and create a new document.

2) Change the font to Optima 13-point.

3) Type a lowercase letter g.

Note how the descender is clipped - the very last pixel is not drawn. If you 
then hit return, you'll see that it does get drawn properly now that the next 
line has been displayed, so it seems that the last pixel is pushed into the 
next line fragment rect. (If you then type another lowercase g, then hit 
return again, then backspace twice to get rid of the return character and the 
second g, you will see that the g gets deleted but the single pixel-high 
part of its descender that was on the next line is left behind as a sort of 
drawing artefact.)

So, essentially all I want to do is force a little extra drawing to get rid of 
these drawing bugs, but it seems forcing this extra drawing is a little more 
complicated than I had at first thought. For the past three years, my shipping 
app has worked around this bug by overriding 
-setNeedsDisplayInRect:avoidAdditionalLayout: in a custom NSTextView to force a 
little extra vertical drawing, e.g:

- (void)setNeedsDisplayInRect:(NSRect)aRect avoidAdditionalLayout:(BOOL)flag
{
// Redraw an extra six pixels above and below to avoid font-rendering bugs.
if (flag)
aRect = NSIntersectionRect(NSInsetRect(aRect, 0, -6), [self visibleRect]);
[super setNeedsDisplayInRect:aRect avoidAdditionalLayout:flag];
}

Until now, this has worked fine. However, for the next version of my software 
I've introduced a page layout view with zoom in/zoom out, which works much the 
same as the multiple-text-container wrap-to-page mode in TextEdit, and I 
noticed that at certain scales (e.g. 110%), I would get single-pixel blank 
lines drawn through the text in some places. Upon investigating, it turned out 
that my -setNeedsDisplayInRect:avoidAdditionalLayout: method was to blame - 
drawing an extra six pixels above and below would cause problems when drawing 
at some scales. (I had arbitrarily chosen six extra pixels hoping to provide 
enough extra padding for all fonts.)

Has anyone else combatted this bug and found a way around it? What is the 
correct way to force NSTextView to draw a little extra around each line in such 
a way that it won't cause any problems? (Perhaps I need to address it at the 
NSLayoutManager level?) It may be that I can just use the above code and change 
the extra padding to redraw only one extra pixel above and below, but I'm 
nervous about doing that given the problems described above.

Many thanks in advance for any suggestions.

All the best,
Keith


  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Christian Ziegler
Hi all!

I would like to step in here for a related question. Is there any way to get 
rid of the compiler warnings if you use the generated accessors without writing 
a subclass of NSManagedObject and adding properties and method declarations?

Regards,
Chris
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Mike Abdullah

On 23 Apr 2010, at 10:46, Christian Ziegler wrote:

 Hi all!
 
 I would like to step in here for a related question. Is there any way to get 
 rid of the compiler warnings if you use the generated accessors without 
 writing a subclass of NSManagedObject and adding properties and method 
 declarations?

No there isn't. But the xcode modeller can easily generate those method 
declarations for you when writing a new class.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Roland King
yes there is - and it's in the documentation too

http://developer.apple.com/mac/library/documentation/cocoa/conceptual/CoreData/Articles/cdAccessorMethods.html

If you are not using a custom class, to suppress compiler warnings you can 
declare the properties in a category of NSManagedObject:

and it gives you an example there as well. 


On 23-Apr-2010, at 6:21 PM, Mike Abdullah wrote:

 
 On 23 Apr 2010, at 10:46, Christian Ziegler wrote:
 
 Hi all!
 
 I would like to step in here for a related question. Is there any way to get 
 rid of the compiler warnings if you use the generated accessors without 
 writing a subclass of NSManagedObject and adding properties and method 
 declarations?
 
 No there isn't. But the xcode modeller can easily generate those method 
 declarations for you when writing a new class.
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Joanna Carter
Hi Christian

 I would like to step in here for a related question. Is there any way to get 
 rid of the compiler warnings if you use the generated accessors without 
 writing a subclass of NSManagedObject and adding properties and method 
 declarations?

Normally, generating a subclass also generates a category that declares the 
necessary methods:

@interface One (CoreDataGeneratedAccessors)
- (void)addManyObject:(NSManagedObject *)value;
- (void)removeManyObject:(NSManagedObject *)value;
- (void)addMany:(NSSet *)value;
- (void)removeMany:(NSSet *)value;

@end

If you didn't want to generate a specific class, you can always write a 
category on NSManagedObject:

@interface NSManagedObject (CoreDataGeneratedAccessors)
- (void)addManyObject:(NSManagedObject *)value;
- (void)removeManyObject:(NSManagedObject *)value;
- (void)addMany:(NSSet *)value;
- (void)removeMany:(NSSet *)value;

@end

Joanna

--
Joanna Carter
Carter Consulting
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Mike Abdullah
ah, good point. Seems pretty ugly though as you start suggesting that all 
managed objects support those methods. It only takes a moment to generate a 
subclass that does this.

On 23 Apr 2010, at 11:28, Roland King wrote:

 yes there is - and it's in the documentation too
 
 http://developer.apple.com/mac/library/documentation/cocoa/conceptual/CoreData/Articles/cdAccessorMethods.html
 
 If you are not using a custom class, to suppress compiler warnings you can 
 declare the properties in a category of NSManagedObject:
 
 and it gives you an example there as well. 
 
 
 On 23-Apr-2010, at 6:21 PM, Mike Abdullah wrote:
 
 
 On 23 Apr 2010, at 10:46, Christian Ziegler wrote:
 
 Hi all!
 
 I would like to step in here for a related question. Is there any way to 
 get rid of the compiler warnings if you use the generated accessors without 
 writing a subclass of NSManagedObject and adding properties and method 
 declarations?
 
 No there isn't. But the xcode modeller can easily generate those method 
 declarations for you when writing a new class.
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Christian Ziegler
Hi all!

First of all shame on me, I didn't read this article entirely (one of my very 
very bad traits ;-) ), thanks very much though for pointing it out. Given the 
very good arguments I think it's better to create subclasses. Also thanks to 
Mike I figured out how to easily create those subclasses. Very cool!

Cheers,
Chris

On 23.04.2010, at 13:01, Mike Abdullah wrote:

 ah, good point. Seems pretty ugly though as you start suggesting that all 
 managed objects support those methods. It only takes a moment to generate a 
 subclass that does this.
 
 On 23 Apr 2010, at 11:28, Roland King wrote:
 
 yes there is - and it's in the documentation too
 
 http://developer.apple.com/mac/library/documentation/cocoa/conceptual/CoreData/Articles/cdAccessorMethods.html
 
 If you are not using a custom class, to suppress compiler warnings you can 
 declare the properties in a category of NSManagedObject:
 
 and it gives you an example there as well. 
 
 
 On 23-Apr-2010, at 6:21 PM, Mike Abdullah wrote:
 
 
 On 23 Apr 2010, at 10:46, Christian Ziegler wrote:
 
 Hi all!
 
 I would like to step in here for a related question. Is there any way to 
 get rid of the compiler warnings if you use the generated accessors 
 without writing a subclass of NSManagedObject and adding properties and 
 method declarations?
 
 No there isn't. But the xcode modeller can easily generate those method 
 declarations for you when writing a new class.
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org
 
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Bill Appleton
hi all,

wow thanks for the advice. i agree i will need to ultimately know a lot
about cocoa to make the transition

i don't have a lot of choices, in that the engine i am porting is about 1/2
million lines of C, and about 10,000 enterprise companies depend on it,
mainly on windows, although a significant number of them have macs

so i have made a lot of efforts to learn cocoa, but our product is an NPAPI
browser plugin, so we have to switch from carbon windowrefs to cocoa
nswindows because that is what the NPAPI interface provides. in fact much of
the architecture is dictated by this interface which runs under WebKit /
Safari / Firefox.

so its a real world scenario instead off the best of all possible worlds

but its great to meet so many knowledgeable people, i'll have some more
tangible questions as this progresses



thanks,

bill appleton






On Thu, Apr 22, 2010 at 6:39 PM, Michael Ash michael@gmail.com wrote:

 On Thu, Apr 22, 2010 at 6:45 PM, Bill Appleton
 billapple...@dreamfactory.com wrote:
  hi all,
 
  thanks for the great advice
 
  for better or worse i am porting a large piece of enterprise software
 from
  carbon/windows to cocoa/windows
 
  most of the code is platform independent, but i can't make big changes to
  the overall structure of the program
 
  so like step one is to replace WindowRef with NSWindow and watch the
 carnage
  ensue

 Step one should be to actually learn Cocoa.

 You seem to think that because you're going to be just swapping in
 Cocoa for Carbon that you don't really need to know a lot about how
 Cocoa works. In fact, precisely the opposite is true. If that's going
 to be your strategy, you need to know *more* about how Cocoa works
 than the average Cocoa programmer. Cocoa makes it easy to build
 conventional Cocoa apps, and you can often get away with not knowing
 all that much about how stuff works internally. But your proposed
 approach is highly unconventional. To succeed, you'll need to have a
 good understanding of how Cocoa works on the inside. In short, you
 need to know the rules extremely well before you start breaking them.

 Others have already addressed the merits of your proposed approach. If
 you decide to go with it anyway (and I can understand the temptation)
 then you'll probably want to take a time out, get a book or three on
 Cocoa, build a small test application and then expand it until you
 have something that exercises a decent fraction of the framework, and
 *then* come back and start doing your conversion.

 Mike
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:

 http://lists.apple.com/mailman/options/cocoa-dev/billappleton%40dreamfactory.com

 This email sent to billapple...@dreamfactory.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Accessibility for NSTableView

2010-04-23 Thread Houdah - ML Pierre Bernard
Hi!

I have a table view which lists files.  I would like to make the represented 
objects available through Accessibility. I.e. I want to add 
NSAccessibilityURLAttribute and NSAccessibilityFilenameAttribute to the table 
rows.

So far, I have come up with this:

- (id)accessibilityHitTest:(NSPoint)point;
{
NSObject *row = [super accessibilityHitTest:point];

if (row != nil) {
@try {
NSNumber *rowNumber = [row valueForKey:@row];

NSObject *dataSource = [self dataSource];
ResultItem *resultItem = [dataSource tableView:self 
objectValueForTableColumn:nil row:[rowNumber intValue]];

[row accessibilitySetOverrideValue:[resultItem pathURL] 
forAttribute:NSAccessibilityURLAttribute];
[row accessibilitySetOverrideValue:[resultItem path] 
forAttribute:NSAccessibilityFilenameAttribute];
}
@catch (NSException *exception) {
NSLog(@exception: %@, exception);
}
}

return row;
}

Sadly, this is not working. Neither attribute is visible in the Accessibility 
Inspector.

Best,
Pierre Bernard
Houdah Software s.à r.l.

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Dave DeLong
Aha!  I overlooked that one because I was expecting the method to accept two 
parameters. Thanks! :)

Dave

Sent from my iPhone

On Apr 22, 2010, at 2:39 PM, Keary Suska cocoa-...@esoteritech.com wrote:

 -mutableSetValueForKey:
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Paul Sanders
I had a vaguely similar requirement in that I wanted to port my Windows app to 
Cocoa and I wanted to do it (and indeed did do it) by writing a 'Windows 
emulation library' on top of Cocoa.  This took about a year.

To get started, I wrote a very simple one-window Cocoa program ('Cocoa 
Testbench') using the 'Cocoa application' template in Xcode.  While this 
involves getting to grips with Interface Builder it provides a shortcut to 
having something you can experiment with on an ongoing basis, and knowing IB is 
a useful skill anyway.  And I have a bit of good news for you: Cocoa is very 
hackable, once you get into it.  My initial fear that it was just a high-level 
RAD tool went away quite quickly.

I also found reading up on Objective-C very valuable.  It is more subtle than 
at first appears.  I found Apple's online documents more than adequate for 
this.  Other than that, I can only echo the advice given by others: buy a 
couple of 'get you started' books (Hillegass is very readable) and be prepared 
to invest quality time in learning the Cocoa framework.  You can probably 
ignore Core Data and KVO though, at least at first.  I did, and, for what I am 
doing, I do not miss them.  Tell you what though; taking in so much new 
material is very tiring, mentally.  Get plenty of sleep and forget everything 
you know about Carbon.

Paul Sanders.

- Original Message - 
From: Bill Appleton billapple...@dreamfactory.com
To: Michael Ash michael@gmail.com
Cc: cocoa-dev cocoa-dev@lists.apple.com
Sent: Friday, April 23, 2010 3:08 PM
Subject: Re: NSApplicationMain question


hi all,

wow thanks for the advice. i agree i will need to ultimately know a lot
about cocoa to make the transition

i don't have a lot of choices, in that the engine i am porting is about 1/2
million lines of C, and about 10,000 enterprise companies depend on it,
mainly on windows, although a significant number of them have macs

so i have made a lot of efforts to learn cocoa, but our product is an NPAPI
browser plugin, so we have to switch from carbon windowrefs to cocoa
nswindows because that is what the NPAPI interface provides. in fact much of
the architecture is dictated by this interface which runs under WebKit /
Safari / Firefox.

so its a real world scenario instead off the best of all possible worlds

but its great to meet so many knowledgeable people, i'll have some more
tangible questions as this progresses

thanks,

bill appleton
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Reason for menuNeedsUpdate notification?

2010-04-23 Thread David Reitter
How would I go about determining the reason for a menuNeedsUpdate notification?

My app gets these both for key presses and clicks on the menu.  I would like to 
only update it for clicks, because updating the menu is slow (and will be even 
slower when done separately for each menu item, via numberOfItemsInMenu: and 
menu:updateItem:atIndex:shouldCancel).

Looking at the event type is not reliable.  While clicks are normally 
SysDefined events, they become AppDefined as soon as VNC/ARD or even mouse 
enhancement utilities such as BetterTouchTool are used.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Reason for menuNeedsUpdate notification?

2010-04-23 Thread Paul Sanders
NSMenuDidBeginTrackingNotification might do what you want.  Note that, despite 
what the docs say, this is not sent on Tiger.

Paul Sanders

- Original Message - 
From: David Reitter david.reit...@gmail.com
To: cocoa-dev@lists.apple.com
Sent: Friday, April 23, 2010 4:31 PM
Subject: Reason for menuNeedsUpdate notification?

How would I go about determining the reason for a menuNeedsUpdate notification?

My app gets these both for key presses and clicks on the menu.  I would like to 
only update it for clicks, because updating the menu is slow (and will be even 
slower when done separately for each menu item, via numberOfItemsInMenu: and 
menu:updateItem:atIndex:shouldCancel).

Looking at the event type is not reliable.  While clicks are normally 
SysDefined events, they become AppDefined as soon as VNC/ARD or even mouse 
enhancement utilities such as BetterTouchTool are used.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Jens Alfke

On Apr 23, 2010, at 7:08 AM, Bill Appleton wrote:

 so i have made a lot of efforts to learn cocoa, but our product is an NPAPI 
 browser plugin

Whoa, hold on, stop the music —

That changes things. You’re not writing an app, then. So you have no 
NSApplicationMain. You’re just writing a bundle with the same NPAPI entry 
points, which will be loaded and called by an already-running browser app. 
There shouldn’t be much Cocoa code needed at all, I would guess — mostly you’d 
be getting the CG context out of the view you’re told to draw into, and using 
Quartz calls to draw into that.

I can’t really help you in more detail because I have no experience writing 
browser plugins. The WebKit development list might be more useful, since this 
is not typical Cocoa programming...

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Bill Appleton
hi jens

you are right about all of that except we also run in stand alone
application mode, and we also have floating palettes and scripting windows
(etc) in developer mode in the browser

(i'm the guy who wrote supercard if that explains anything to the
old-timers)


thx

bill




On Fri, Apr 23, 2010 at 9:00 AM, Jens Alfke j...@mooseyard.com wrote:


 On Apr 23, 2010, at 7:08 AM, Bill Appleton wrote:

  so i have made a lot of efforts to learn cocoa, but our product is an
 NPAPI browser plugin

 Whoa, hold on, stop the music —

 That changes things. You’re not writing an app, then. So you have no
 NSApplicationMain. You’re just writing a bundle with the same NPAPI entry
 points, which will be loaded and called by an already-running browser app.
 There shouldn’t be much Cocoa code needed at all, I would guess — mostly
 you’d be getting the CG context out of the view you’re told to draw into,
 and using Quartz calls to draw into that.

 I can’t really help you in more detail because I have no experience writing
 browser plugins. The WebKit development list might be more useful, since
 this is not typical Cocoa programming...

 —Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Reason for menuNeedsUpdate notification?

2010-04-23 Thread Eric Schlegel

On Apr 23, 2010, at 8:31 AM, David Reitter wrote:

 How would I go about determining the reason for a menuNeedsUpdate 
 notification?

On 10.6, you can use -[NSMenu propertiesToUpdate] from within your 
menuNeedsUpdate delegate to determine what aspects of the menu need to be 
updated. In the key press case, you should observe that (for example) 
NSMenuPropertyItemImage is not set, so if updating the item's image is slow, 
you could avoid doing that work.

There isn't a good way to get this info prior to 10.6.

-eric

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Paul Sanders
 (i'm the guy who wrote supercard if that explains anything to the old-timers)

It does.  Respect.

Paul Sanders.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


overwriting own bundle

2010-04-23 Thread Philip White
Hello,
  Is it acceptable for an application to overwrite its own bundle, say as part 
of an update? Assuming of course that it can get any necessary elevated 
privileges? Or should I spawn a task that waits for the app to quit and then 
overwrite it?

Thanks,
  Philip
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: overwriting own bundle

2010-04-23 Thread Dave Carrigan

On Apr 23, 2010, at 9:38 AM, Philip White wrote:

  Is it acceptable for an application to overwrite its own bundle, say as part 
 of an update? Assuming of course that it can get any necessary elevated 
 privileges? Or should I spawn a task that waits for the app to quit and then 
 overwrite it?


Have a look at the sparkle framework, for doing updates. I believe what it does 
is moves the app bundle to the trash then drops in the new app bundle.

Just overwriting your app bundle while the app is running is likely to lead to 
trouble.

-- 
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


showing a list of mounted volumes with icon

2010-04-23 Thread Angelo Chen
Hi,
Just like when press 'Option' while booting, we can see a list of volumes with 
icons, is there a simple way to do something similar in a sheet? Thanks,
Angelo



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: showing a list of mounted volumes with icon

2010-04-23 Thread Kyle Sluder
On Fri, Apr 23, 2010 at 10:01 AM, Angelo Chen
angelochen...@yahoo.com.hk wrote:
 Hi,
 Just like when press 'Option' while booting, we can see a list of volumes 
 with icons, is there a simple way to do something similar in a sheet? Thanks,

What is the part you're trying to emulate, the appearance or the
functionality? Do you just need a horizontal collection of things, do
you just need to collect a list of mounted volumes and their icons, or
do you want to combine the two somehow to make something similar to
the Startup Disk preference pane? What purpose is this UI going to
serve?

The EFI boot selector is hardly the first place I'd look to for
inspiration for desktop UI.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: overwriting own bundle

2010-04-23 Thread Jens Alfke


On Apr 23, 2010, at 9:43 AM, Dave Carrigan wrote:

Have a look at the sparkle framework, for doing updates. I believe  
what it does is moves the app bundle to the trash then drops in the  
new app bundle.


+1. This is tricky to do right, and the fewer self-update frameworks  
there are, the better for everyone (including Apple as they deal with  
compatibility issues down the road.)


Just overwriting your app bundle while the app is running is likely  
to lead to trouble.


Indeed. Especially if something goes wrong halfway through, leaving  
your app bundle a chimera that won't launch, or even worse, does  
launch but misbehaves in subtle ways that generate lots of tech  
support issues for you.


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: overwriting own bundle

2010-04-23 Thread Paul Sanders
  Is it acceptable for an application to overwrite its own bundle, say as part 
 of an update? Assuming of course that it can get any necessary elevated 
 privileges? Or should I spawn a task that waits for the app to quit and then 
 overwrite it?

Do you install from an mpkg?  I just download that (well, the dmg), tell the 
user what's going to happen next and then mount the dmg (via hdiutil) and quit 
the App.  Installer.app then does it's usual stuff.  The welcome screen in my 
package says something like 'if you have an existing installation it will be 
upgraded'.

This makes the whole procedure very simple.

Paul Sanders.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Paul Sanders
 you [Jens] are right about all of that except we also run in stand alone
 application mode, and we also have floating palettes and scripting windows
 (etc) in developer mode in the browser

I would think, then, that mastering the anatomy of a standard Cocoa application 
would be well worthwhile.  You might want to re-do your palettes and suchlike 
as nibs, for example, and at the very least you should know how to do this, 
otherwise how can you make an informed decision on which is the right approach? 
 A 'Cocoa Testbench' app will also let you experiment with event handling in an 
NSWindow - presumably events will turn up through in the normal way through 
your NSWindow's sendEvent: method under NSAPI so you can take a look at that.

But NSWindows are simple beasts.  You will need to learn all about NSViews and 
the rich set of subclasses (like NSButton) that constitute the Aqua 'widget 
set'.  These are right at the heart of the way a Cocoa app interacts with the 
user and it's unlikely that you will be able to (or indeed want to) avoid them.

Presumably, your existing code has a way to layout widgets in a window and some 
kind of platform-independent event model. Once you know enough about how Cocoa 
works, you might be able to constuct your window layouts on the fly from 
whatever code or data structures currently build your UI, and you might be able 
to feed Cocoa events (e.g. a button press, to pick a very simple example) back 
through your existing event model.

That's essentially what I do - I build the NSView hierarchy for a window from a 
Windows .res file and I have a reasonably convincing facsimile of the Windows 
messaging model to handle events.  But then I graduated from the school of the 
terminally weird.  It works though, although as I say it took a while to put it 
all together, and I now have common code across the two platforms with a 
reasonably native look-and-feel, which is what I wanted.  Tough luck about 
Linux, but then that's not important to me.

Looks like you have an interesting journey ahead of you.

Paul Sanders.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Paul Sanders
 I build the NSView hierarchy for a window from a Windows .res 
 file ...

It's worth adding that I started with a substantial base of 
working, well-tested Windows code.  My approach would not 
otherwise be justified.  But with 1/2 million lines of code, you 
must be in an analogous situation.  It's a bit like the old 
Irish joke that goes 'What's the best way to get to Dublin?' --  
'Well I wouldn't start from here'.  No offence intended to any 
Irish readers BTW, it's a terrific place.

Paul Sanders. 



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Paul Sanders
 I build the NSView hierarchy for a window from a Windows .res 
 file ...

Or do you have your own 'bare metal' widget set?  If you are already 
cross-platform, I guess you probably do.  In which case [NSWindow sendEvent:] 
is what you're looking for - everything comes through there -  plus the NS or 
CG Graphics context you can get by locking focus on the Window's content view 
for drawing in.

I knew I'd get there in the end!

Paul Sanders. 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationMain question

2010-04-23 Thread Jack Carbaugh


On Apr 23, 2010, at 12:06 PM, Bill Appleton wrote:


(i'm the guy who wrote supercard if that explains anything to the
old-timers)



Mad respect! Kudos dude. Loved supercard!

jack
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Reason for menuNeedsUpdate notification?

2010-04-23 Thread David Reitter
On Apr 23, 2010, at 11:47 AM, Paul Sanders wrote:

 NSMenuDidBeginTrackingNotification might do what you want.  Note that, 
 despite what the docs say, this is not sent on Tiger.

This notification does not give me the actual menu, but I am now using it in 
combination with menuNeedsUpdate: the notification is sent before the 
menuNeedsUpdate message.

This seems to work fine and should be compatible with 10.5; it depends on the 
order of events, so using [NSMenu propertiesToUpdate]  as per Eric's suggestion 
from 10.6 on should do the trick.

Both of you, thank you for your quick 
help.___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Localizing of print dialogs

2010-04-23 Thread danchik
Hi, is there something that I need to do to make the dialogs (not the ones 
included with app) come up localized?

For example, calling [printOperation runOperation] brings up the print dialog 
always in English, even though the user language should be Russian for example

BUT doing print from say TextEdit does bring up the print dialog in Russian

I don't have anything localized at the moment, but I though that the system 
resources like the print dialog would come up in the sysstem language??

Thank You
Dan
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: showing a list of mounted volumes with icon

2010-04-23 Thread Angelo Chen
Hi Kyle,
I'd just like show a collection of mounted volumes in a sheet and let user 
choose one of them.
Thanks,
Angelo

--- 2010年4月24日 星期六,Kyle Sluder kyle.slu...@gmail.com 寫道﹕

寄件人: Kyle Sluder kyle.slu...@gmail.com
主題: Re: showing a list of mounted volumes with icon
收件人: Angelo Chen angelochen...@yahoo.com.hk
副本(CC): Cocoa-dev@lists.apple.com
日期: 2010年4月24日,星期六,上午1:51

On Fri, Apr 23, 2010 at 10:01 AM, Angelo Chen
angelochen...@yahoo.com.hk wrote:
 Hi,
 Just like when press 'Option' while booting, we can see a list of volumes 
 with icons, is there a simple way to do something similar in a sheet? Thanks,

What is the part you're trying to emulate, the appearance or the
functionality? Do you just need a horizontal collection of things, do
you just need to collect a list of mounted volumes and their icons, or
do you want to combine the two somehow to make something similar to
the Startup Disk preference pane? What purpose is this UI going to
serve?

The EFI boot selector is hardly the first place I'd look to for
inspiration for desktop UI.

--Kyle Sluder




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: showing a list of mounted volumes with icon

2010-04-23 Thread James Walker
On 4/23/2010 5:47 PM, Angelo Chen wrote:

 I'd just like show a collection of mounted volumes in a sheet and let
user choose one of them.

Carbon has a call just for this (NavCreateChooseVolumeDialog) but I
don't see anything so easy for Cocoa.  You can get a list of volumes
with NSFileManager, get their icons with NSWorkspace, and then build
your own sheet, maybe using NSTableView.

-- 
  James W. Walker, Innoventive Software LLC
  http://www.frameforge3d.com/
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com