Re: Screensaver running only on one display with a multiple display setup

2023-06-12 Thread Steven Mills via Cocoa-dev
On Jun 10, 2023, at 12:45, Gabriel Zachmann via Cocoa-dev 
 wrote:
> 
> Two of the instances never reach method -viewDidMoveToWindow.
> 
> Is there a way to instrument the source code or the executable, such that I 
> can receive a line-by-line trace of the execution of the three screensaver 
> instances from that user?
> 
> I am wondering if two of the instances are crashing.
> But I don't know how to retrieve more info about it (if any).

By logging when init and viewDidMoveToWindow methods, you can see when the 
latter fails to be called. It's a bug Apple needs to fix. They broke it some 
time ago, then didn't fix it when the partially fixed legacy screensavers in 
13.4. Just continue to report their bugs.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Retrieving the EXIF date/time from 250k images

2023-01-16 Thread Steven Mills via Cocoa-dev
On Jan 16, 2023, at 00:52, Gabriel Zachmann via Cocoa-dev 
 wrote:
> 
> I had thought of that , too.
> The reason is that I have no experience whatsoever with the JPEG file format.
> Nor with the EXIF file format.
> Also, I need to be able to parse at least JPEG, PNG, TIF, GIF, and I'd like 
> to add HEIC.

The file format docs are out there for all of those (at least I assume heic is 
published, too), and many of them are pretty straight forward. Learning how to 
read those files is a good learning experience and keeps you from being at the 
mercy of 3rd party solutions that you have no control over, or that aren't 
efficient at getting right to the data you need.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Mystery interference with AirPlay

2022-06-15 Thread Steven Mills via Cocoa-dev
On Jun 15, 2022, at 03:44:41, Gabriel Zachmann via Cocoa-dev 
 wrote:

> Making matters worse, I don't have AirPlay.

Everybody has Airplay. It's a feature, not a thing.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Programmatically created NSButton is drawn in the wrong position.

2020-12-15 Thread Steven Mills via Cocoa-dev
On Dec 15, 2020, at 04:49:19, Eyal Redler via Cocoa-dev 
 wrote:
> 
> setting translatesAutoresizingMaskIntoConstraints to yes makes the situation 
> worse. The buttons are drawn further away than their frames indicate.

Are you using Xcode's Interface Debugger to inspect the entire view hierarchy 
and see what the frames of everything actually are, or are you just measuring 
pixels in a screenshot or something to determine that they're 6 points to the 
right?

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How can I get horizontal scrollbars adequate to the widest list entry

2020-11-11 Thread Steven Mills via Cocoa-dev
On Nov 11, 2020, at 10:13:35, Andreas Falkenhahn  wrote:
> 
> Yeah, but size.width is 0 too so something must be wrong in that code...

Does it even have a superview at that point? I kinda think it doesn't, because 
the method you're in is supposed to return the cell view that the table will 
then stick into the row. And yes, its width will be 0 because it has no content 
yet.

> No, because your words "mess with the constraints" didn't sound like this was
> going to be a very elegant solution ;) 
> 
> Have you got any code on how to add constraints to the text field? I don't
> really have the time to read and understand the whole auto layout shebang
> just to give this a try. 
> 
> After all, I can't even get the NSTextField's size so I'm a bit skeptical
> if auto layout is going to solve this since even such basic things as getting
> the NSTextField's size don't seem to work...

Well, constraints are the way to go. If you don't want to take the time to 
learn them or even how tables and view coordinates work, then I'm done offering 
suggestions.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How can I get horizontal scrollbars adequate to the widest list entry

2020-11-11 Thread Steven Mills via Cocoa-dev
On Nov 11, 2020, at 09:38:37, Andreas Falkenhahn  wrote:
> 
> 
> Ok, but how can I get those distances? I've tried the following:
> 
>NSView *view = [tableView viewAtColumn:0 row:idx makeIfNecessary:YES];
>NSRect bounds = [view bounds];
> 
> But bounds.origin.x and bounds.size.width are always 0...

Did you try my other suggestions first? If the layout system can handle this 
for you, then your work is done.

You also need to learn how view coordinates work. A view's bounds will almost 
always have an origin of 0,0. What you want is the view's frame, which is the 
rectangle of the view as seen by its superview.

The field's left offset in its superview is field.frame.origin.x.
The field's right offset in its superview is field.superview.frame.size.width - 
NSMaxX(field.frame).

Add those 2 values to the widest measured string width.

But really, you should look into the constraint suggestions first. Constraints 
are powerful and make your job much easier once you learn how they work.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How can I get horizontal scrollbars adequate to the widest list entry

2020-11-11 Thread Steven Mills via Cocoa-dev
On Nov 11, 2020, at 08:54:02, Andreas Falkenhahn via Cocoa-dev 
 wrote:
> 
> However, this still isn't perfect because the last two characters of the 
> widest entry are still cut off and replaced by "...". Of course, I can solve 
> this by just adding something a few points to size.width but of course I 
> don't want that because I'm looking for a solution that works with all UI 
> fonts and sizes so hard-coding a certain point value that is added to 
> size.width is definitely a no-go...

Yes, just add a fudge factor to ensure the column will be wide enough to 
accommodate the string width AND the spacing between the left and right edges 
of the actual NSTextField in the cell. You can inspect the field in the table 
to see those distances.

You might even be able to mess with the constraints on the text field to force 
field to never shrink smaller than the text by adding constraints to the field 
and setting the Content Compression Resistance Priority, Horizontal to 1000 or 
something at least higher than 750. Try turning on the field's Single Line Mode 
as well.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Missing log output

2020-11-09 Thread Steven Mills via Cocoa-dev
On Nov 9, 2020, at 08:10:16, Gabriel Zachmann via Cocoa-dev 
 wrote:
> 
> In more details, my app (written in Swift) logs info using NSLog, like so:
> 
>   NSLog( "App group container: %@", container_group_url_!.path )
> 
> I asked the user to extract the log message using this command in the 
> Terminal:
> 
>   log show --start "2020-07-06 08:20:00" --predicate 'process == "Name of 
> App"' --info --debug

And you're 100% sure the user is doing the right thing, both in your app and 
with the log command? Why not have them simply look in Console and filter on 
your app?

At any rate, it's good to plan ahead and use a different logging mechanism, one 
without all the complications and unknowns of the system log. Like #define your 
own logging command, which can then be routed to any number of different 
systems, even turned on/off by the user if you plan right.

#define log_to_normal 0

#if log_to_normal
#define LOG(x, ...) NSLog(x, ##__VA_ARGS__)
#else
Illustrating 2 different approaches that produce the same result in the end:
#define LOG(x, ...) Logger(x, ##__VA_ARGS__)
or
#define LOG(args...) Logger(__FILE__, __LINE__, __PRETTY_FUNCTION__, 
args)
#endif

Where Logger is your own function or class that simply append-writes to a text 
file in ~/Library/Application Support//log.txt or whatever. The 
Logger can have an on/off switch that is toggled by a secret menu item so 
normally it doesn't not log, but when you need the user to turn it on, you can 
instruct them how to show the secret menu item or whatever.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to parse a log file

2020-10-27 Thread Steven Mills via Cocoa-dev
On Oct 27, 2020, at 00:54:40, Rob Petrovec  wrote:
> 
>   While I agree this would be a good thing to have, I don’t see how Xcode 
> could find the dSYM to use given that they are typically ephemeral.  The dSYM 
> is tied to the build.  So if you build your project twice you will have two 
> different dSYMs. Only the dSYM for the build that generated the crash log 
> file will be able to symbolicate it.  So, if you want to symbolicate your 
> crash logs you need to save your dSYM files & resulting app bundle somewhere 
> for each build of your app you publish.  Then you can use them to symbolicate 
> user logs.
>   What Xcode could do, however, is (given a path to a directory 
> containing all the dSYMs for your published builds) parse the log to figure 
> out which dSYM/app bundle pair in the directory to use (probably based on 
> build info and/or version) and symbolicate.  You would also need to take the 
> additional step of properly updating these values in your project for each 
> published build.

Yes, it would do the same thing that the doc tells us as humans to do, but it 
could do it much more efficiently and speedily. It can easily find the correct 
archive, as long as you're a good developer and don't throw out your official 
build archives.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to parse a log file

2020-10-26 Thread Steven Mills via Cocoa-dev


> On Oct 26, 2020, at 17:49:59, James Walker via Cocoa-dev 
>  wrote:
> 
> I don't see any "Download Debug Symbols" in the Organizer.  I don't think it 
> exists for macOS apps.
> 
> However, one can right-click on an archive and select "Show In Finder", then 
> once in Finder right-click again and Show Package Contents, and drill down to 
> find dSyms.  (Usually just one, but if your app builds with a private 
> framework, there could be more.)

Yes, Apple needs to remember when writing docs that not all apps are for 
mobile! I have to refer to that doc every time I get a user crashlog, once or 
twice a year, and it always take the same amount of time to figure out what 
they're talking about. I really hope they make this a more automatic feature in 
Xcode: Open the project, open a crashlog, choose a menu item to symbolicate, 
and let Xcode do the confusing part about loading the dsym from the archives.

--
Steve Mills
Drummer, Mac geek

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: CIImage initWithCGLayer is deprecated in 10.11

2016-06-11 Thread Steven Spencer
From CIImage.h:

- (instancetype)initWithCGLayer:(CGLayerRef)layer
NS_DEPRECATED_MAC(10_4,10_11,"Use initWithCGImage: instead.");
- (instancetype)initWithCGLayer:(CGLayerRef)layer
options:(nullable CI_DICTIONARY(NSString*,id) *)options
NS_DEPRECATED_MAC(10_4,10_11,"Use initWithCGImage:options instead.");



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Wanted: new owner for Mac apps

2013-05-09 Thread Steven Degutis
Alex, I think my favorite part of your response is that, what I said
wasn't something to be vaguely recalled, a lost moment enveloped in a
foggy memory, a fragment of a conversation hopelessly swallowed by the
past. There was no reason to settle for remembering something to the
effect of it.

On Thu, May 9, 2013 at 3:10 AM, Charles Srstka cocoa...@charlessoft.com wrote:
 On May 8, 2013, at 7:25 PM, Alex Zavatone z...@mac.com wrote:

 On May 8, 2013, at 8:17 PM, Luther Baker wrote:

 Steve's entire thread was about giving away his source code -- he even 
 keeps us up to date as it starts to leave his hands ... and you read 
 snippy into that last comment? ... and then decide to publicly call him 
 out on it?

 Yes.

 Because I read it as it appeared he was giving away his code, then the 
 repository was pulled down, someone complained and he said something to the 
 effect of now you have learned that nothing's permanent.

 Considering that he announced giving away the code just a few days ago and 
 pulled the repo already, that part came across as snippy.

 Is this really necessary?

 Charles

 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Can scroll direction be changed programmatically?

2013-05-09 Thread Steven Degutis
I found a solution using AppleScript[1] but it seems like it may be fragile
(uses magic numbers, etc).

Is there another way?

-Steven

[1]
http://apple.stackexchange.com/questions/60877/toggle-natural-scrolling-from-command-line-with-reload
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Steven Degutis
 What are you actually trying to accomplish?

I often switch between using my rMBP directly, and plugging it into
this giant monitor. When I'm just using the rMBP's trackpad, I want
the scroll direction to be natural. But when I'm plugged in and using
a mouse, I'd prefer it to be unnatural.

So I'm hoping to find some way of programmatically doing this. Then I
can plug my solution into my Zephyros config and bind it to a global
hotkey. This app is super handy.

It would be even better actually if I could find some notification
that's triggered when you plug into or unplug from an external
monitor, then it would automatically toggle this for me.

I found out that it's the global defaults key
com.apple.swipescrolldirection, but I can't figure out how to force
every open app to notice the new value when I set it. Seems like I'd
probably have to kill loginwindow or something to get the OS to
register that I changed this. And that seems like a dumb idea.

-Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Steven Degutis
Kinda like https://github.com/invariant/Scroll-Reverser ? Someone
showed me this and I glanced at the source code, and was not fond of
this technique.

On Thu, May 9, 2013 at 7:26 PM, Uli Kusterer
witness.of.teacht...@gmx.net wrote:
 On 09.05.2013, at 20:55, Steven Degutis sbdegu...@gmail.com wrote:
 I found a solution using AppleScript[1] but it seems like it may be fragile
 (uses magic numbers, etc).

 Is there another way?


 I wonder if an event tap and just changing the direction on each scroll event 
 would work? Could also listen to CGDisplayConfigurationChanged callback in 
 the app that filters the events to see when an external screen is plugged in.

 Cheers,
 -- Uli Kusterer
 The Witnesses of TeachText are everywhere...
 http://www.masters-of-the-void.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-08 Thread Steven Degutis
Snippy? I'm having a hard time figuring out which part could be snippy.

The part about the different interpretations of the sort order of the
list of forks? I just found it a neat observation and wanted to share.

The part about people deleting their own forks? Just wanted to warn
people that they might want to fork one sooner than later.

The part about permanence being an illusion? Maybe a bit melancholy,
but certainly not snippy.

-Steven

On Wed, May 8, 2013 at 9:17 AM, Alex Zavatone z...@mac.com wrote:

 On May 8, 2013, at 1:14 AM, Steven Degutis wrote:

 It's funny how when you say in order of but omit the direction,
 people have different assumptions:
 https://github.com/biohazardffm/grs/network/members

 On Tue, May 7, 2013 at 1:37 PM, Steven Degutis sbdegu...@gmail.com wrote:
 Update:

 The original repo has been deleted.

 Take a look at one of these forks, in order of most-recently-forked
 (and therefore most up-to-date):

 https://github.com/biohazardffm/grs
 https://github.com/nivekkagicom/grs
 https://github.com/cpowers/grs
 https://github.com/pariahware/grs
 https://github.com/jinie/grs
 https://github.com/ddelmonte/grs
 https://github.com/shaz/grs
 https://github.com/iainx/grs

 Goodness knows how long any of these people will keep their forks
 before they each decide to delete their own fork.

 If none of them exist by the time you read this, well then sorry. At
 least you'll have learned sooner than later that permanence is an
 illusion.

 -Steven

 sarcasmThank you for teaching us so much./sarcasm  That's a rather snippy 
 comment to send off to the list.


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-08 Thread Steven Degutis
Alex, does this mean you aren't gonna buy me a PaintCode license out
of gratitude? Dang. :(

On Wed, May 8, 2013 at 7:25 PM, Alex Zavatone z...@mac.com wrote:

 On May 8, 2013, at 8:17 PM, Luther Baker wrote:

 Steve's entire thread was about giving away his source code -- he even keeps 
 us up to date as it starts to leave his hands ... and you read snippy into 
 that last comment? ... and then decide to publicly call him out on it?

 Yes.

 Because I read it as it appeared he was giving away his code, then the 
 repository was pulled down, someone complained and he said something to the 
 effect of now you have learned that nothing's permanent.

 Considering that he announced giving away the code just a few days ago and 
 pulled the repo already, that part came across as snippy.


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
These ones: https://github.com/sdegutis/grs

They're a lovely little set of Mac apps. Most of them are on the App
Store, and with absolutely no marketing they've been making about $42
per month. I'm sure with marketing they'll do much better.

This repo also includes AppGrid, which had a huge cult following for
the 20 people I've given away free licenses to. They all highly prefer
it over Divvy/SizeUp/etc. But again, haven't done marketing.

If anyone's interested in taking any or all these apps, just let me
know. I'll take them off the store and you can put them up.

For the curious, I'm giving them away because

-Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Alternatively, anyone and everyone is welcome to fork these apps, or
do whatever you want with them. I'm releasing all of that repo under
the MIT license. Give them away for free, sell them, whatever, I don't
care.

On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Also, I've just updated the README to include all sorts of pertinent
information. Please consult it for important details on each app.

On Tue, May 7, 2013 at 9:08 AM, Steven Degutis sbdegu...@gmail.com wrote:
 Alternatively, anyone and everyone is welcome to fork these apps, or
 do whatever you want with them. I'm releasing all of that repo under
 the MIT license. Give them away for free, sell them, whatever, I don't
 care.

 On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Ok.

On Tue, May 7, 2013 at 9:38 AM, Tom von Schwerdtner tomv...@gmail.com wrote:
 On Tue, May 7, 2013 at 9:54 AM, Steven Degutis sbdegu...@gmail.com wrote:

 These ones: https://github.com/sdegutis/grs

 (...)

 For the curious, I'm giving them away because


 I think something got cut off here...?

 -Tom
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Few updates:

1. I'm leaving the repo up for a little while so people can fork it.
Anyone who wants to learn how a 5-year Cocoa dev does things, can just
browse the source code, and maybe learn a thing or two.

2. I was mistaken on their income, it's more like $20 a month (with no
marketing), if that. Sorry for the misinformation.

3. Several people have claimed an app or two, and they plan to put it
in the App Store. So if you're one of them, just check to make sure
it's not in the App Store first. If there's nothing there with the
same name, then you're good to go.

4. Found some stray reviews from a few months ago. Put them in the
README for easy finding.

5. Trying to figure out how to take apps down from the Mac App Store,
once they're down I'll ping the final pong to this list.

-Steven

On Tue, May 7, 2013 at 9:32 AM, Steven Degutis sbdegu...@gmail.com wrote:
 Also, I've just updated the README to include all sorts of pertinent
 information. Please consult it for important details on each app.

 On Tue, May 7, 2013 at 9:08 AM, Steven Degutis sbdegu...@gmail.com wrote:
 Alternatively, anyone and everyone is welcome to fork these apps, or
 do whatever you want with them. I'm releasing all of that repo under
 the MIT license. Give them away for free, sell them, whatever, I don't
 care.

 On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
I'll spare your partner the effort. This is the exhaustive list:

- http://www.macworld.com/article/1142376/docks2.html
- 
http://www.addictivetips.com/mac-os/get-email-alerts-mac-menu-bar-shortcuts-for-multiple-gmail-accounts/
- https://twitter.com/unclebobmartin/status/309712348044730368
- https://twitter.com/trptcolin/status/309324069134794755
- Plus the App Store reviews that I put in the readme file

-Steven

On Tue, May 7, 2013 at 10:09 AM, Scott Andrew
scottand...@roadrunner.com wrote:
 Hmmm. Wonder how long they'll last. Can you do me a bit of research. See if 
 you can find reviews on these. The read me in the link has their names. See 
 what people think of em.

 Sent from my iPhone

 On May 7, 2013, at 6:54 AM, Steven Degutis sbdegu...@gmail.com wrote:

 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com

 This email sent to scottand...@roadrunner.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Also, sorry about the unfinished sentence at the end, it happened because

On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Okay, the apps are removed from the App Store. Have at it.

On Tue, May 7, 2013 at 10:42 AM, Steven Degutis sbdegu...@gmail.com wrote:
 Also, sorry about the unfinished sentence at the end, it happened because

 On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
I really have no idea how many people have claimed what. They're open
source and MIT, so if you want to take any, just fork it.

On Tue, May 7, 2013 at 11:01 AM, Danny W. Pimienta
da...@tapswipepinch.com wrote:
 Any of the apps left unclaimed? I'm not at a computer at the moment but would 
 like to take one.

 Sent from my iPhone

 On May 7, 2013, at 9:54 AM, Steven Degutis sbdegu...@gmail.com wrote:

 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/danny%40tapswipepinch.com

 This email sent to da...@tapswipepinch.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
Update:

The original repo has been deleted.

Take a look at one of these forks, in order of most-recently-forked
(and therefore most up-to-date):

https://github.com/biohazardffm/grs
https://github.com/nivekkagicom/grs
https://github.com/cpowers/grs
https://github.com/pariahware/grs
https://github.com/jinie/grs
https://github.com/ddelmonte/grs
https://github.com/shaz/grs
https://github.com/iainx/grs

Goodness knows how long any of these people will keep their forks
before they each decide to delete their own fork.

If none of them exist by the time you read this, well then sorry. At
least you'll have learned sooner than later that permanence is an
illusion.

-Steven

On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Main Window Disappears when Loaded from Separate NIB File

2013-05-07 Thread Steven Degutis
ARC is on. Retain the window controller.

On Tue, May 7, 2013 at 4:52 PM, Thomas Wetmore t...@verizon.net wrote:
 I hope someone can put me straight. I created a vanilla Cocoa App. I deleted 
 the window from the MainMenu.xib and created a MainWindow.xib with 
 essentially an identical window (no views).

 I created a MainWindowController with one overriding method, init, see below. 
 In the app delegate's applicationDidFinishLaunching method I create the main 
 window controller and attempt to show the main window. If I breakpoint just 
 after the [mainController showWindow: nil] method I can see the proper user 
 interface with the main menu and main window. However, when I let the program 
 run the window immediately disappears. As none of my code runs after that 
 point I'm at a bit of a loss discovering what makes the window go away.

 What am I doing (or not doing) that causes the main window to close or become 
 invisible? The code is below.

 Thanks,

 Tom Wetmore

 AppDelegate.h:
 --
 @interface AppDelegate : NSObject NSApplicationDelegate
 @end

 AppDelegate.m:
 --
 #import AppDelegate.h
 #import MainWindowController.h

 @implementation AppDelegate

 - (void) applicationDidFinishLaunching: (NSNotification*) aNotification {
 MainWindowController* mainController = [[MainWindowController alloc] 
 init];
 [mainController window]; // force controller to load nib.
 [mainController showWindow: nil];  // show window -- which promptly 
 disappears
 }

 @end


 MainWindowController.h:
 ---
 @interface MainWindowController : NSWindowController
 @end

 MainWindowController.m:
 ---
 #import MainWindowController.h

 @implementation MainWindowController

 - (id) init { return [super initWithWindowNibName: @MainWindow]; }

 @end


 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Showing numpad key equivs in menu items

2013-05-07 Thread Steven Degutis
That's the problem with legacy. We learn from the past, and realize
our mistakes. But sometimes we can't fix them, because users already
depend on them. Or rather, we do fix them, and anger lots of people
who need it to keep working the old way. Reminds me of
http://xkcd.com/1172/ ... legacy: can't live with it, can't get rid
of it.

On Tue, May 7, 2013 at 6:45 PM, gweston gwes...@mac.com wrote:
 Steve Mills said:

 Such software has already established the precedent that it needs lots and
 lots of keyboard shortcuts. (Finale is well over 10 years old, IIRC.) Steve
 isn't condemning users to a keyboard shortcut nightmare, he's continuing a
 well-established though specialized UI pattern. On this point I 100% agree
 with Steve's right to continue the tradition without molestation.


 Finally, somebody that understands. Thanks for explaining it all.

 Don't confuse disagreement with lack of understanding. I understood what you
 were asking perfectly. I didn't say you absolutely shouldn't do it. You
 might recall that I even made a good faith suggestion for a technique that
 might accomplish it. But I also offered a reasoned rationale for why
 carrying that forward *might* not be the best use of your efforts. You
 reacted with snide hostility to a polite and sincere attempt to help you
 make your software as good as it could be. Think about that for a bit. (And
 that goes double for Steven who claimed that making such suggestions was the
 mark of a fanboy.)



 In that case, I think Steve needs to quit whining that Apple engineers
 aren't doing his job for him, and implement his own menu drawing for his
 specialized case.


 It's not that Apple isn't doing my job for me, it's that they're not doing
 their own job. Carbon had this ability. They didn't re-add it in Cocoa.
 That's what I'm complaining about. Apple killed Carbon and said use Cocoa!
 It's amazing! Convert all your apps now! That would be a whole lot easier
 if Cocoa offered everything that Carbon did.

 You need to consider the possibility that Apple decided that not everything
 Carbon was able to do was legitimate to carry forward. That some of it might
 have even been fundamentally detrimental to user experience. It's among the
 most common reasons for behavior to be deprecated.



 Yes, if Apple comes up with better glyphs for numpad keys (and some of the
 others while they're at it), then that's all the better. Somewhere I recall
 seeing a little numpad icon beside the actual key character. Even that would
 be more obvious than a rounded rect around the character.

 You may be surprised to hear that I agree. Remember, I made two arguments.
 Not everyone has the keys and the glyph isn't sufficiently descriptive.
 Better glyph immediately eliminates the more problematic half of my concern.
 You could quite easily do the little numpad icon yourself, just like
 whatever developer created the one you remember.

 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
One more thing:

If you end up doing something cool with any of these apps, please let
me know. I'm kinda nerdy so I like hearing about that kinda stuff.

On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-07 Thread Steven Degutis
It's funny how when you say in order of but omit the direction,
people have different assumptions:
https://github.com/biohazardffm/grs/network/members

On Tue, May 7, 2013 at 1:37 PM, Steven Degutis sbdegu...@gmail.com wrote:
 Update:

 The original repo has been deleted.

 Take a look at one of these forks, in order of most-recently-forked
 (and therefore most up-to-date):

 https://github.com/biohazardffm/grs
 https://github.com/nivekkagicom/grs
 https://github.com/cpowers/grs
 https://github.com/pariahware/grs
 https://github.com/jinie/grs
 https://github.com/ddelmonte/grs
 https://github.com/shaz/grs
 https://github.com/iainx/grs

 Goodness knows how long any of these people will keep their forks
 before they each decide to delete their own fork.

 If none of them exist by the time you read this, well then sorry. At
 least you'll have learned sooner than later that permanence is an
 illusion.

 -Steven

 On Tue, May 7, 2013 at 8:54 AM, Steven Degutis sbdegu...@gmail.com wrote:
 These ones: https://github.com/sdegutis/grs

 They're a lovely little set of Mac apps. Most of them are on the App
 Store, and with absolutely no marketing they've been making about $42
 per month. I'm sure with marketing they'll do much better.

 This repo also includes AppGrid, which had a huge cult following for
 the 20 people I've given away free licenses to. They all highly prefer
 it over Divvy/SizeUp/etc. But again, haven't done marketing.

 If anyone's interested in taking any or all these apps, just let me
 know. I'll take them off the store and you can put them up.

 For the curious, I'm giving them away because

 -Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Showing numpad key equivs in menu items

2013-05-06 Thread Steven Degutis
Part of the territory. Apple knows better than you, thus so do its fanboys.

On Mon, May 6, 2013 at 10:20 PM, Steve Mills smi...@makemusic.com wrote:
 On May 6, 2013, at 16:58:10, gweston gwes...@mac.com wrote:

 In light of the great opportunity for user confusion - because a little 
 rectangle around the number is hardly a clear indicator - and the reality 
 that many users do not have a number pad, I think the solution I'd recommend 
 is to rethink the choice of key equivalents so as to obviate the problem.

 So a rounded rect around a number is not a clear indictor that it's a 
 different character? People have been able to clearly see the difference 
 between í, ì, and i for hundreds of years, so that's a pretty lame excuse. 
 I've never been confused seeing these numpad glyphs in good ol' Carbon menus.

 That said, if you insist on going down this path, it might work to include 
 NSNumericPadKeyMask in the key equivalent mask for the item.

 This only affects the key used to trigger it, not the appearance of the glyph 
 in the menu item.

 But seriously: Think about how much you want to annoy notebook users first.

 OK, we'll annoy them by taking away key equivs they've been used to using in 
 our app for the past umpteen years.

 Why is it that people on these lists prefer giving their opinions instead of 
 technical knowledge?

 --
 Steve Mills
 office: 952-818-3871
 home: 952-401-6255
 cell: 612-803-6157



 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Enable Unique Selection

2013-05-03 Thread Steven Degutis
Personally I would just use the value transformer approach. It's easy,
obvious, and discoverable. Any other solution I can think up with
would be lacking in at least one of these. I actually find value
transformers to be super helpful when working with bindings. I've used
one for an empty string (that trims newlines and whitespace before
checking length), for an empty array, and probably some more.

On Fri, May 3, 2013 at 11:54 PM, Gerriet M. Denkmann
gerr...@mdenkmann.de wrote:

 On 3 May 2013, at 17:07, Andy Lee ag...@mac.com wrote:

 On May 3, 2013, at 1:29 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
 I have a button which only makes sense when exactly one thing is selected.
 Currently it's Enabled property is bound to Array 
 Controller.selectedObjects.@count.
 I.e. the button is enabled if one or more things are selected.

 But I want it to be disabled when nothing is selected AND also if more than 
 one thing is selected.
 Is there a way to do this without code?

 If not - what to do ? Create a value transformer? Or what else?

 I vaguely remember doing this by adding a readonly property to the array 
 controller -- something like exactlyOneIsSelected -- with a corresponding 
 getter method. Then you can bind to ArrayController.exactlyOneIsSelected.

 Then the question would be how to trigger KVO on that property. I don't 
 remember what I did. My first thought would be to implement +(NSSet 
 *)keyPathsForValuesAffectingExactlyOneIsSelected, but I'm not sure what to 
 return. Maybe @selectionIndexes? Would @selectedObjects.@count work? I 
 don't know if you can use aggregation in keyPaths...Affecting... methods.

 It might be useful to implement these methods on a category of 
 NSArrayController if you need this logic in multiple places.

 As usual I have a nagging feeling there's a better way, but this at least 
 should work.

 An interesting idea.

 I created a ValueTransformer like:

 @implementation UniqueTransformer

 + (Class)transformedValueClass { return [ NSNumber class ]; }

 - (id)transformedValue:(id)value
 {
 BOOL unique = [ value respondsToSelector: @selector(integerValue) ]  
   [ value integerValue ] == 1;
 return @(unique);
 }

 @end

 Seems to me rather less code. Maybe still not the best way to do it, but the 
 best I could think of.


 Kind regards,

 Gerriet.



 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Is FSEvents more efficient than polling?

2013-04-28 Thread Steven Degutis
There is a library I'm using that is reading a list of files every 0.5
seconds and watching for the last-modified attribute to change.

Is this less efficient than using FSEvents? If so, how? For example, will
it weak down the HDD or SSD faster? Run the battery of my laptop out
sooner? Some other way?

Thanks.

-Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Is FSEvents more efficient than polling?

2013-04-28 Thread Steven Degutis
Let me give a little more context. The app is a Clojure
test-auto-runner[1], that spins up the JVM and watches files to reload
and re-run the tests for[2].

I'm concerned that running this auto-runner on my laptop is killing
the SSD and battery quicker. Especially because these rMBPs don't have
easily-replaceable parts, so once it's dead, it's probably dead for
good.

If it is a real concern, I have a plan. I previously wrote a little
utility before called fswatch[3] that watches for changes and runs a
script. I can just alter this stay open until you kill it, and print
the changed files to stdout at every fs-event. Then I'd just open this
process in Clojure and watch its stdout for files and reload when I
see them.

[1] https://github.com/slagyr/fresh/blob/master/src/fresh/core.clj
[2] See the usage section in the URL x-dictionary:preposition
[3] https://github.com/crh/fswatch

On Sun, Apr 28, 2013 at 12:52 PM, Michael Starke
michael.sta...@hicknhack-software.com wrote:
 An educated guess would be that polling should be less efficient as the event 
 based FSEvents.
 Any reason you do not want to tap into the FSEvents API?

 You concerns about weakening is nothing I would consider, as you're talking 
 about reading, which should be considered harmless (in the physical sense, 
 not the performance point of view)

 -Michael

 On 28.04.2013, at 19:43, Steven Degutis sbdegu...@gmail.com wrote:

 There is a library I'm using that is reading a list of files every 0.5
 seconds and watching for the last-modified attribute to change.

 Is this less efficient than using FSEvents? If so, how? For example, will
 it weak down the HDD or SSD faster? Run the battery of my laptop out
 sooner? Some other way?

 Thanks.

 -Steven
 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com

 This email sent to michael.sta...@hicknhack-software.com


 ___m i c h a e l   s t a r k e
geschäftsführer
HicknHack Software GmbH
www.hicknhack-software.com

 ___k o n t a k t
+49 (170) 3686136
cont...@hicknhack.com

 ___H i c k n H a c k   S o f t w a r e   G m b H
geschäftsführer - maik lathan | andreas reischuck | michael starke
bayreuther straße 32
01187 dresden
amtsgericht dresden HRB 30351
sitz - dresden


 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Steven Degutis
Using blocks with ARC just requires more discipline, that's all. It isn't
to be avoided, just carefully thought about at the appropriate times.


On Thu, Apr 25, 2013 at 6:07 AM, Oleg Krupnov oleg.krup...@gmail.comwrote:

 The compiler indeed warns, but only for ARC projects, and for non-ARC
 projects it perfectly allows blocks to create retain cycles without
 any warnings, even Xcode's Analyze doesn't help.

 Besides, I'm afraid the compiler is not always capable to detect all
 such dangerous situations even with ARC on.

 So I am afraid it ends up with lots of retain cycles in virtually
 every project that uses blocks, but programmers just don't notice
 and/or just don't care. Do you often check your projects for leaks of
 this kind? You will be surprised if you do try.

 My point remains: blocks are dangerous and there is no easy way to
 ensure they are safe. You can't avoid referencing self in blocks,
 because it is the very point of almost every callback block. So you
 have to every time to remind yourself to jump through hoops to avoid
 the retain cycles. Nah.



 On Thu, Apr 25, 2013 at 1:45 PM, Tom Davie tom.da...@gmail.com wrote:
 
  On 25 Apr 2013, at 11:40, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
  I don't agree, blocks are very powerful.
 
  I am using Xcode 4.6 and in a project that uses ARC it was throwing
 warnings when a block reference to a property caused a retain cycle. This
 is how I found it and why I mentioned it in another thread in the first
 place.
 
  I haven't tested it extensively, but it looks as if the compiler
 recognises these situations easily and then tells you about it.
 
  So I wouldn't call blocks dangerous at all…
 
  You're right – the compiler *is* detecting some simple cases, as I
 suggested!  Note – this does not make throwing blocks around without paying
 attention to retain cycles inherently safe though, the compiler can not
 statically infer all potential cycles.
 
  Thanks
 
  Tom Davie

 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: ANN: new open-source window manager for OS X

2013-04-18 Thread Steven Degutis
True, but I'm confident they don't care. :)


On Thu, Apr 18, 2013 at 1:00 AM, Charles Srstka cocoa...@charlessoft.comwrote:

 On Apr 17, 2013, at 11:44 AM, Steven Degutis sbdegu...@gmail.com wrote:

 Called Windows.app.


 ... I think someone may have used the name Windows already...

 Charles

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ANN: new open-source window manager for OS X

2013-04-18 Thread Steven Degutis
Thanks :)

The crux of it is that you can bind global hotkeys to your own JavaScript
(or CoffeeScript) functions, and from your JS (or CS) config file, you have
access to an API[1] that lets you control and inspect all open windows and
apps.

On the wiki I have some examples of how you can use this to make something
kind of like a tiling window manager. One of them[2] mimics the
closed-source app AppGrid[3] that I wrote the other week (which actually
turned out to be a spectacular commercial failure because I don't know how
to market).

Technically the API is ObjC, so it could do anything you can otherwise do
in an app, it's not just limited to letting you move/resize windows. For
example, last night I added the functions `open` and `shell`, and today I
added a binding to my own config[4] that opens Dictionary.app.

[1] https://github.com/sdegutis/windowsapp#api
[2] https://github.com/sdegutis/windowsapp/wiki/AppGrid-config
[3] http://giantrobotsoftware.com/appgrid
[4] https://github.com/sdegutis/home/blob/master/.windowsapp.coffee#L13

-Steven


On Thu, Apr 18, 2013 at 7:21 PM, Graham Cox graham@bigpond.com wrote:

 Fantastic! What does it do?

 --Graham


 On 18/04/2013, at 2:44 AM, Steven Degutis sbdegu...@gmail.com wrote:

  Called Windows.app. Source is on github:
  https://github.com/sdegutis/windowsapp
 
  What's particularly neat about it is how you configure it. It looks for a
  dotfile in your home dir, which can either be JavaScript or CoffeeScript.
  In this config file you, bind your hot keys as you want, using a very
  simple API that the app exposes in JS-land.
 
  I managed to get JavaScript scripting working via JSCocoa, and
 CoffeeScript
  via coffeescript.js and Coffeescript.compile(). Technically I hide the
 ObjJ
  syntax away, since most people are much more comfortable in pure JS than
 in
  ObjJ. I was looking into adding ClojureScript support, but I'm not yet
 sure
  how to avoid the start-up delay when running java. Waiting 5 seconds each
  time you reload your config isn't ideal.
 
  My first choice for scripting was to use MacRuby, but it only works with
 GC
  apps, and this one uses ARC. I hear they've got ARC in the works, so my
  fingers are crossed for the future. Also, PyObjC is really hard to
  integrate into an app. Ironically enough, when I was googling for how to
 do
  it, I found an article I wrote about it 3 years ago when I was working at
  BNR.
 
  Also, I created a technique for generating appcasts statically from the
  command line, and hosting the appcast on github, that might be
 interesting
  to other open source authors who don't want to have any other hosting but
  github. The details are in this build.sh file:
  https://github.com/sdegutis/windowsapp/blob/master/build.sh
 
  My apologies if new-app announcements are off-topic, but I think this one
  is particularly suitable for cocoa-dev because of the technical details.


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


ANN: new open-source window manager for OS X

2013-04-17 Thread Steven Degutis
Called Windows.app. Source is on github:
https://github.com/sdegutis/windowsapp

What's particularly neat about it is how you configure it. It looks for a
dotfile in your home dir, which can either be JavaScript or CoffeeScript.
In this config file you, bind your hot keys as you want, using a very
simple API that the app exposes in JS-land.

I managed to get JavaScript scripting working via JSCocoa, and CoffeeScript
via coffeescript.js and Coffeescript.compile(). Technically I hide the ObjJ
syntax away, since most people are much more comfortable in pure JS than in
ObjJ. I was looking into adding ClojureScript support, but I'm not yet sure
how to avoid the start-up delay when running java. Waiting 5 seconds each
time you reload your config isn't ideal.

My first choice for scripting was to use MacRuby, but it only works with GC
apps, and this one uses ARC. I hear they've got ARC in the works, so my
fingers are crossed for the future. Also, PyObjC is really hard to
integrate into an app. Ironically enough, when I was googling for how to do
it, I found an article I wrote about it 3 years ago when I was working at
BNR.

Also, I created a technique for generating appcasts statically from the
command line, and hosting the appcast on github, that might be interesting
to other open source authors who don't want to have any other hosting but
github. The details are in this build.sh file:
https://github.com/sdegutis/windowsapp/blob/master/build.sh

My apologies if new-app announcements are off-topic, but I think this one
is particularly suitable for cocoa-dev because of the technical details.

-Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Apple Aperture-like look feel

2012-08-18 Thread Steven Woolgar

otool is your friend when you want to find these things out.

Aperture, Logic and the other Apple Pro apps use a framework called 
ProKit.  It is internal and private.


See: /System/Library/PrivateFrameworks/ProKit.framework
The images are in a custom binary file: 
/System/Library/PrivateFrameworks/ProKit.framework/Versions/A/Resources/ProThemeBits.car



W.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSDocument disc undo stack

2012-04-02 Thread Steven
If there's no mechanism to persist the app undo states and undo manager 
messages, how should apps that support undo work with the automatic termination 
behaviour ?
Should automatic termination be set dynamically and disabled when undo history 
is present ?
A user might be annoyed if the undo history were lost when the app went off 
screen.

the system may also quit an app with open windows if the app is not currently 
on screen, perhaps because the user hid it or switched spaces.

TextEdit (in 10.7) retains its undo history beyond save, until the document or 
application is closed.

Steven.


 
 
 On 25/03/2012, at 5:34 AM, Doug Clinton wrote:
 
 I don't know if this was the issue that Steven was asking about, but I've 
 been wondering if there is a recommended way to persist the undo stack so 
 that it's still available if you restart the app, or close and re-open the 
 document. It's always bothered me that there is this great mechanism for 
 handling undo, but that all the history is thrown away when you close the 
 app.
 
 
 No easy way I know of. The undo architecture relies on a huge amount of state 
 within the app external to the undo stack itself. You'd have to save all of 
 that state somehow.
 
 In fact, most apps throw away the undo history on a document save (you 
 arrange this), as a way to recover the memory used by undo, since the whole 
 state is being saved in the file anyway. Versions are the supported mechanism 
 for persistent document undo.
 
 --Graham
 
 
 
 

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSDocument disc undo stack

2012-03-25 Thread Steven
Thanks for the info Graham.
I'm using NSUndoManager.  I thought that many large objects in the stack would 
cause memory pressure and would be better occupying disc space as they are only 
needed at undo/redo time.  Good to know that the VM system will take care of it.

Steven.

On 24 Mar 2012, at 01:04, Graham Cox wrote:

 You can read and write to the Application Support folder.
 
 But FILES in an Undo stack? That makes little sense to me.
 
 If you want to undo changes to a file, store the changes or the command that 
 will cause the changes in the undo stack. If you are changing the 
 organisation of files on disc then save a description of that organisation in 
 the undo stack. You may want to read up on the way Cocoa utilises Undo, 
 because it sounds like you might not have a good grasp on it.
 
 Even if you need to store very large objects in the undo stack, unless you 
 can prove it's a serious problem, just let the memory get paged to disk VM 
 naturally. It's rare that users need to undo a very long history, so even if 
 the older history is paged out, the chances are the user will never know.
 
 --Graham
 
 
 
 
 
 On 24/03/2012, at 10:17 AM, Steven wrote:
 
 Hello,
 
 Where is the correct place to store an on-disc undo stack associated with a 
 NSDocument instance ?
 The stack may contain several potentially large files so we don't want them 
 to occupy memory.
 For a compound document the stack could reside in a directory NSFileWrapper.
 For a single file document should a temporary directory be used ?
 I guess the chosen location may need to persist beyond the occurrence of the 
 automatic termination feature.
 Any advice appreciated.
 Thanks.
 
 Steven.
 ___
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com
 
 This email sent to graham@bigpond.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSDocument disc undo stack

2012-03-23 Thread Steven
Hello,

Where is the correct place to store an on-disc undo stack associated with a 
NSDocument instance ?
The stack may contain several potentially large files so we don't want them to 
occupy memory.
For a compound document the stack could reside in a directory NSFileWrapper.
For a single file document should a temporary directory be used ?
I guess the chosen location may need to persist beyond the occurrence of the 
automatic termination feature.
Any advice appreciated.
Thanks.

Steven.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
 The same issue came up again later the same day:

__block UIBackgroundTaskIdentifier bti = [[UIApplication sharedApplication]
beginBackgroundTaskWithExpirationHandler: 
 ^{
[[UIApplication sharedApplication] endBackgroundTask:bti];
}];

 Without __block, bti is invalid, and you won't find that out easily because 
 it's unlikely that you'll actually expire. :) m.


Can this be right?
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
Thanks, I'm just surprised that this common, often cited example is broken.

http://books.google.co.uk/books?id=bwQY3_5FMg8Cpg=PA775lpg=PA775dq=beginBackgroundTaskWithExpirationHandlersource=blots=aMuw5-hiP6sig=NFKFDhaPw41KnfOo1n7Z_OaJflMhl=ensa=Xei=T-s_T76JEaOl0AW0y-iPDwved=0CGoQ6AEwCTgK#v=onepageq=beginBackgroundTaskWithExpirationHandlerf=false

That's an awful lot of broken code.


On 18 February 2012 17:23, Fritz Anderson fri...@manoverboard.org wrote:
 On 18 Feb 2012, at 7:41 AM, steven Hooley wrote:

 The same issue came up again later the same day:

   __block UIBackgroundTaskIdentifier bti = [[UIApplication 
 sharedApplication]
                                   beginBackgroundTaskWithExpirationHandler: 
 ^{
       [[UIApplication sharedApplication] endBackgroundTask:bti];
   }];

 Without __block, bti is invalid, and you won't find that out easily because 
 it's unlikely that you'll actually expire. :) m.

 Can this be right?

 If I understand why you're mystified, consider this, without the __block 
 declaration.

 - bti starts as junk.

 - The block is instantiated, and captures the junk _value_ (because it's not 
 a __block variable) of bti.

 - The beginBackgroundTask… method creates the background task identifier.

 - That identifier is then assigned to bti. bti is no longer junk, but that 
 does the block no good, because it's already captured the junk value.


 If bti is declared __block, the block captures (notionally) a _reference_ to 
 bti. It doesn't evaluate bti until it executes, which will be after the 
 assignment.

        — F


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
 That's exactly *why* I've been asking about it - so I can fix it (and explain 
 the fix) for the new edition:

Sorry, I did not mean to imply 'many people have done it wrong because
of this book'. What i Failed at saying was but.. I've seen this
pattern everywhere, even in Apple sample code, it can't be a bug!. I
thought this because i'd never seen the taskId declared as __block in
the sample code or docs.

Of course, i'd made an error not noticing that in the sample code/docs
the UIBackgroundTaskIdentifier is always an iVar and not realising
that this was critical to it's operation (and why i'd never seen it
declared __block).

I really appreciate you finding my bugs for me.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSView mouseDown truncated coordinates

2011-11-27 Thread Steven

Many thanks for your replies, Jens and Ken.

I use the mouseMoved event to set the mouse cursor according to whether a 
NSBezierPath instance contains the mouse point [pathInstance containsPoint:], 
to indicate whether the path can be moved.  There is no scale transformation on 
the view.  On the boundary of the path, the mouseMoved and the mouseDown events 
disagree whether the mouse point is contained by the path even though the mouse 
pointer has not moved. e.g. mouseMoved says the point is outside the path, 
whereas mouseDown says it is inside the path.
The cursor indication gives a false impression that the path cannot be moved 
when it actually can be moved.
The disagreement is caused by the fractional part of the location coordinates 
in mouseMoved and the integral coordinates in mouseDown.

I thought that high precision mouse/trackpad movement was possible and that the 
location could be adjusted to match the screen resolution using NSView 
centerScanRect.  However, centerScanRect (arithmetically) rounds the location 
to the nearest pixel whereas mouseDown has truncated the location.
It looks like I may have to truncate the coordinates in mouseMoved, to match 
what mouseDown does.
I noticed that NSWindow mouseLocationOutsideOfEventStream does produce the 
non-integral coordinates when called from mouseDown, though that may not be the 
right direction to go.

Steven

___

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


NSView mouseDown truncated coordinates

2011-11-25 Thread Steven Spencer
Hi,

I'm using a NSTrackingArea in a view to receive mouseMoved events.
The cursor location in the mouseMoved and mouseDragged events have non-integer 
coordinates (as expected).
e.g. x:140.601562 y:128.082031

However, the mouseDown and mouseUp events always produce truncated coordinates.
e.g. x:140.00 y:128.00

This causes inaccuracy with hit testing between mouseMoved and mouseDown.

All the mouse events use the same code to convert the point for the view :

NSPoint location = [self convertPoint:[theEvent locationInWindow] 
 fromView:nil];

Logged as e.g.

NSLog(@moved x:%f y:%f, location.x, location.y);

What is the correct way to obtain coordinates that are consistent across all 
the mouse events ?
Thanks.

Steven

(Xcode 4.2.1 64bit LLVM 3.0 ARC)
___

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


NSBezierPath HiDPI

2011-09-10 Thread Steven Spencer

Hello,

What is the correct way to draw a pixel aligned bezier path for HiDPI display 
modes ?
I've got the following code to draw a rounded rectangle in both standard 
1440x900 and HiDPI 720x450 resolutions, 
though it seems overly complex.
Is there a simpler solution, perhaps an api method ?
I have to rerun the code for it to take account of a display resolution change, 
how do I fix this ?

Thanks.

Steven


Lion, Xcode 4.1, Garbage collection on.
--

#import Cocoa/Cocoa.h

@interface TestView : NSView
{
NSBezierPath *thePath;
}
- (NSAffineTransform *)transformationToDrawBezierPath:(NSBezierPath *)path 
alignedInView:(NSView *)view 
   centredAtX:(CGFloat)x
y:(CGFloat)y
   alignPathWidth:(BOOL)alignPathWidth;
@end

--

#import TestView.h

@implementation TestView

- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {
NSRect bounds = NSMakeRect(100.0, 100.0, 60.0, 60.0);
thePath = [NSBezierPath bezierPathWithRoundedRect:bounds xRadius:6.0 
yRadius:6.0];
[thePath setLineWidth:0.0];
}

return self;
}

- (BOOL)isFlipped
{
return YES;
}

- (void)drawRect:(NSRect)dirtyRect
{
NSAffineTransform* transform = [self transformationToDrawBezierPath:thePath
  alignedInView:self
 centredAtX:123.0
  y:84.0
 alignPathWidth:YES];   
 
[transform concat];
[[NSColor blueColor] set];
[thePath stroke];
[transform invert];
[transform concat];
}

- (NSAffineTransform *)transformationToDrawBezierPath:(NSBezierPath *)path 
alignedInView:(NSView *)view 
   centredAtX:(CGFloat)x
y:(CGFloat)y
   alignPathWidth:(BOOL)alignPathWidth;
{
CGFloat onePixelWidth = [self convertSizeFromBacking:NSMakeSize(1.0, 
1.0)].width;
CGFloat halfPixelWidth = onePixelWidth * 0.5; 
NSInteger lineWidthPixelCount = MAX(1, (NSInteger) round([path lineWidth] / 
onePixelWidth));
BOOL isLineWidthEven = lineWidthPixelCount %2 == 0;

NSRect pathBounds = [path bounds];
NSRect alignedBounds = [self centerScanRect:pathBounds];
NSRect insideBounds;
NSPoint pathCentrePoint = NSMakePoint(NSMidX(pathBounds), 
NSMidY(pathBounds));

//Note : used centerScanRect to align the target point as, 
convertPointToBacking, 
//only modified the y coordinate (followed by convertPointFromBacking).
NSRect target = [self centerScanRect:NSMakeRect(x, y, 1.0, 1.0)];

if (isLineWidthEven) {
//Place an even line width path between pixels
insideBounds = alignedBounds;
} else {
//Inset an odd line width path on the centre of pixels
insideBounds = NSInsetRect(alignedBounds, halfPixelWidth, 
halfPixelWidth);
}

if (alignPathWidth) {
[path setLineWidth:lineWidthPixelCount * onePixelWidth];
}

CGFloat xScale = insideBounds.size.width  / pathBounds.size.width;
CGFloat yScale = insideBounds.size.height / pathBounds.size.height;
CGFloat xScaleInverse = 1.0 / xScale;
CGFloat yScaleInverse = 1.0 / yScale;

NSAffineTransform* transform = [NSAffineTransform transform];

//Scale about the path centre
[transform translateXBy:pathCentrePoint.x 
yBy:pathCentrePoint.y];

[transform scaleXBy:xScale
yBy:yScale];

//Position the path
[transform translateXBy:-pathCentrePoint.x + ((target.origin.x - 
pathCentrePoint.x) * xScaleInverse)
yBy:-pathCentrePoint.y + ((target.origin.y - 
pathCentrePoint.y) * yScaleInverse)];

return transform;
}

@end

___

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: New allowsExternalBinaryDataStorage in Core Data

2011-08-25 Thread Steven Vandeweghe
It seems that when the image (or data in general) is larger than 1MB, it's 
stored in a hidden folder in the same place as your main database. For example, 
if the application is called MyLionApp and its persistent store is located in 
the ~/Library/MyLionApp folder, the external files would be stored in 
~/Library/MyLionApp/.MyLionApp_SUPPORT/_EXTERNAL_DATA/.

The documentation is indeed very sparse, so I've investigated a bit myself and 
posted the results here :

http://bluecrowbar.com/blog/2011/08/coredata-external.html

Steven


On Aug 3, 2011, at 10:29 PM, Frédéric Testuz wrote:

 Hello,
 
 I looked at the Core Data release notes of Lion, I also looked the What's 
 new in Core Data on Mac OS X video of the WWDC 2011. And I have a question 
 about the new allowsExternalBinaryDataStorage option for binary attribute.
 
 I did some test with an attribute for images. I can see that when I put an 
 big image in the data, the file did not grow.
 
 But where the external file/data is put? If the file is moved or copied, what 
 about theses external data? I tried to find info, but the documentation is 
 very sparse.
 
 Frédéric___
 
 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/steven%40bluecrowbar.com
 
 This email sent to ste...@bluecrowbar.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


Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Steven Woolgar
 Slightly OT: Does Apple offer a tool similar to 'indent' for
 formatting? I've never tried indent on Objective C files because it
 does a miserable job on C++ source files.

I use Uncrustify

http://uncrustify.sourceforge.net/

Hope that helps.


W.
___

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


Properties vs Instance Variables

2011-04-26 Thread Guy Steven
I am currently learning objective c and cocoa

I believe I understand the difference between properties and instance
variables, and the effect of using properties as opposed to instance
variables viz a viz KVO and memory management.

What I can't understand is why you would access instance variables directly
within a class. My quess is speed. Is there any other reason?

And related to this, why give instance variables a name different to the
name of the property.

Again, I suspect it may be a matter of style, but would like to know if
there are cases where it is a necessity.
___

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


computing values within NSTableView using bindings

2011-04-21 Thread Guy Steven
I have an NSTableView with 3 columns.


The first contains an NSPop-up which takes as its datasource an array of
objects with two properties, name and cost. The name is displayed.

The user enters a quantity in the 2nd column.

How do I go about displaying the cost in the third column? I can bind that
column to the quantity key, but don't then know the cost, or I can bind the
column to get the cost, but don't then know the quantity?
___

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: How To Increment CALayer Retain Count?

2011-04-11 Thread steven Hooley
 I know its not very popular, but I've disciplined myself to set all
 variables (including stack) to their low or unused state when finished
 with them. It helps locate reuse problems in Debug builds (and I
 really don't care a bit about the 3 cycles). The optimizer can remove
 it later if it desires.

 Sure, setting the variable to nil in dealloc is good practice, just either do 
 it with
 [foo release];
 foo = nil;

How is it good practice? The only thing that this can get you is
masking a bug. Don't do it.
___

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: NSUndoManager retain/release of arguments - ad infinitum

2011-01-11 Thread steven Hooley
I don't mean to hijack this thread, but my first thought, for what
it's worth is that either :-

a) sort order is a property of the window, not your model and
shouldn't be undoable at all.

What happens if you want another view - say a grid view, with nice big
icons - of the same data?. Should that be sorted in the same way as
your tableView? Should clicking the tableView header rearrange views
in other windows? If not.. now you have an undo-stack per window and
you must make sure that they stay in sync. ie. Adding and removing
items happens in both views, and removing an item from one view is
undoable in another, but the sorting and undoing sorting only applies
to the relevant view. This will get pretty messy pretty quickly.

Ok, so you never want to add another view, you're happy with the
single table view. I expect an undoable-action to be a
saveable-action. ie, normally, if i can undo it i expect it to make
the document dirty and need saving. This might be different in your
app but i don't normally expect to have to Save a document because i
switched between sorting alphabetically-ascending and
alphabetically-descending order.

OR b)

the sort order is inherently part of your model, your data is an
ordered-set and the user can arbitrarily order the items as she
pleases. In this case you probably won't be presenting your data with
a sort descriptor, clicking on the column header will actually
rearrange your model data.

Undo/Redo often makes my head hurt, and not always the fault of NSUndoManager.
___

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


Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Is there a preferred way to use the Math.h functions with CGFloats
that is 32 and 64 bit safe?
Do some Macros already exist somewhere?

Should i even be using Math.h functions in Cocoa?

Thanks
___

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


Fwd: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Sorry, 'safe' was a bad choice. I do care because i have compiler
warnings. I have started defining macros for each function and thought
i better check that they didn't already exist.
Thankyou

On 10 August 2010 14:54, Alastair Houghton alast...@alastairs-place.net wrote:
 On 10 Aug 2010, at 13:42, steven Hooley wrote:

 Is there a preferred way to use the Math.h functions with CGFloats
 that is 32 and 64 bit safe?

 Why would they be unsafe?  (They aren't.)

 It's possible that using the double versions (the ones without the f 
 suffix) is inefficient in 32-bit mode, but in practice you're very unlikely 
 to notice.  If you particularly cared, you could #define some macros for 
 them, but I doubt it's worthwhile unless you're going to do some heavy-duty 
 geometry (and in that case, you might find that you want to use double 
 anyway, for accuracy).

 BTW, math.h isn't capitalised; please don't use random upper-case letters 
 when including header files... it causes grief if your source code is ever 
 moved somewhere case-sensitive.

 Should i even be using Math.h functions in Cocoa?

 Why should you not?

 Kind regards,

 Alastair.
___

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: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Yes, sorry - i meant /usr/include/math.h

Because CGFloat is typedef'd to float on 32bit and double on 64bit i
have to swap between, eg,  atan and atanf depending on my build
settings. I have a framework which is intended to support 32bit and
64bit.

I thought this may have been a common scenario and some useful macros
might already exist.
Thanks

On 10 August 2010 14:10, lbland lbl...@vvi.com wrote:
 hi-

 On Aug 10, 2010, at 8:42 AM, steven Hooley wrote:

 Is there a preferred way to use the Math.h functions with CGFloats
 that is 32 and 64 bit safe?
 Do some Macros already exist somewhere?

 Should i even be using Math.h functions in Cocoa?

 What do you mean by Math.h ? Do you mean: math.h (/usr/include/math.h) ?

 You can use math.h in Cocoa.

 math.h is a C standard and doesn't know about CGFloat (except that CGFloat is 
 typedef to double or float). math.h functions generally take doubles (with 
 implicit promotion of floats), or you can use the float counterpart (such as 
 cos() v.s. cosf() ).

 thanks!-

 -lance
___

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: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
But then e.g. when building 32-bit i still have to cast the return
value or i get the warning:-

'implicit conversion shortens 64-bit value into a 32-bit value'

It seems that this warning is my fault because i have added the flag
-Wshorten-64-to-32 which isn't enabled by default so maybe it
shouldn't be?
Thanks

On 10 August 2010 15:19, Graham Cox graham@bigpond.com wrote:

 On 11/08/2010, at 12:12 AM, steven Hooley wrote:

 Because CGFloat is typedef'd to float on 32bit and double on 64bit i
 have to swap between, eg,  atan and atanf depending on my build
 settings. I have a framework which is intended to support 32bit and
 64bit.


 Just use atan(). 32-bit floats are promoted to doubles silently. There is a 
 slight performance penalty but it's absolutely tiny.

 --Graham



___

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: advancementForGlyph problem

2010-05-04 Thread steven Hooley
On 3 May 2010 02:00, David F. dav...@gmx.us wrote:

 How on earth are you determining that it looks like the advancement
 should only be ~23.2 ?

 By counting pixels.


You mean, for example, the distance from the leftmost pixel of the 'A'
to the leftmost pixel in the following glyph? My current thinking is
that given the string 'AB' this distance would be the advance of 'A' -
the x-offset of 'A' + the x-offset of 'B' + tracking + kerning +/- the
inscrutable effect of hinting AB +/- the anti-aliasing of AB. OK the
kerning is probably zero in this case and you could examine the font
to find out. The tracking could well be zero but we don't really have
a way of knowing - but assuming for now that it is zero - the effects
of hinting and anti-aliasing alone would make it difficult to
determine the advance by eye at 36pt, especially to a sub-pixel
accuracy.

How are you drawing the glyphs?

Steve
___

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: advancementForGlyph problem

2010-04-30 Thread steven Hooley
 The information I am getting back from advancementForGlyph doesn't
 seem to be correct.  Here are the glyph bounds and advancement for
 the capital letter 'A' in Georgia 36pt:

 == A ==
 bounds x: -0.720703
 bounds y: 0.00
 bounds w: 25.699219
 bounds h: 25.294922
 advance w: 24.152344
 advance h: 0.00

 The problem that I am seeing is that it looks like the advancement
 should only be 23 (maybe ~23.2).  TextEdit appears to be using an
 advancement of 23 and underlines and strikethroughs are being drawn
 23 pixels wide.

 Any ideas on what I am doing/understanding wrong?

The information is 'correct', ie. it is was it is - the data encoded
in the font scaled to your working size.

How on earth are you determining that it looks like the advancement
should only be ~23.2 ?

TextEdit appears to be using an advancement of 23 How have you
determined this?

If you have infact determined that TextEdit uses and advance of
~23.2px, what makes you think that this is more likely to be correct
than the value encoded in the font, by the font designer?

From your later response it seems like your question is really
regarding drawing strikethroughs and underlines. If so, the strike
through and underline are not part of the glyph or font - they are
just a line drawn from the start point of a range of glyphs to the end
point of a range of glyphs. You cannot draw them piecemeal, a glyph at
a time, and expect them to perfectly match up without overlap or
underlap (apologies for making up a word), as the amount that any 2
glyphs overlap is particular to those 2 glyhps. ie. The strikethrough
of an 'A' followed by a 'V' would need to be a different length than
that of an 'A' followed by a 'j'.
___

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: How to add a DOCTYPE declaration to an NSXMLDocument?

2010-03-31 Thread Steven Spencer

The following code produces the equivalent XML :

NSXMLDocument *myDoc = [[NSXMLDocument alloc] initWithRootElement:[NSXMLElement 
elementWithName:@myDocType]];
NSXMLDTD *myDTD = [[NSXMLNode alloc] initWithKind:NSXMLDTDKind];
[myDTD setName:@myDocType];
[myDoc setDTD:myDTD];
[myDoc setVersion:@1.0];
[myDoc setCharacterEncoding:@UTF-8];

[[myDoc XMLData] writeToFile:[@~/Desktop/TestXML.xml 
stringByExpandingTildeInPath] atomically:YES];

  - Steve


On 31 Mar 2010, at 09:31, cocoa-dev-requ...@lists.apple.com wrote:

 Sounds promising, but the document type declaration doesn't get written
 out to file.
 
 If I create the document using a string instead, it works:
 
 NSString *docString = [NSString stringWithFormat:@!DOCTYPE
 myDocTypemyDocType/myDocType];
 NSXMLDocument *myDoc = [[NSXMLDocument alloc] initWithXMLString:docString
 options:0 error:err];
 [[myDoc DTD] setName:@myDocType];
 
 Seems equivalent to half a dozen other things I tried, but this is the only
 one that works.
 
 Bruce

___

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: Best book for learning Objective c and cocoa

2010-03-31 Thread Steven Degutis
Depending on your level of experience with Cocoa and Objective-C, you may
benefit from Cocoa Programming for Mac OS X, by Big Nerd Ranch:

http://www.bignerdranch.com/book/cocoa
®_programming_for_mac®_os_x_3rd_edition

-Steven

On Wed, Mar 31, 2010 at 8:20 AM, Nikhil Khandelwal 
nikhil_khandel...@persistent.co.in wrote:

 Hi all,

 I am looking for books to learn Objective C and Cocoa. I have good
 knowledge of  oo programming. Also I did a lot of work with Objective C and
 Cocoa using API's and reading through documentation. Please suggest some
 name of good books for knowing Objective C and Cocoa deeper.

 Thanks,
 Nikhil

 DISCLAIMER
 ==
 This e-mail may contain privileged and confidential information which is
 the property of Persistent Systems Ltd. It is intended only for the use of
 the individual or entity to which it is addressed. If you are not the
 intended recipient, you are not authorized to read, retain, copy, print,
 distribute or use this message. If you have received this communication in
 error, please notify the sender and delete all copies of this message.
 Persistent Systems Ltd. does not accept any liability for virus infected
 mails.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Cocoa sometimes raises minor exceptions without logging them

2010-03-17 Thread Steven Degutis
I usually add a breakpoint on objc_exception_throw. Not sure how much of a
difference it makes... but yeah, I agree.

-Steven

On Wed, Mar 17, 2010 at 12:55 PM, Jerry Krinock je...@ieee.org wrote:


 Apparently, Cocoa sometimes raises minor exceptions without logging them,
 so it's good idea to set a breakpoing in +[NSException
 raise:format:arguments:] and run with breakpoints enabled once in awhile.


___

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: Cut and paste out of/ into text fields in a separate window doesn't work

2010-03-16 Thread Steven Degutis
When I say it isn't a native Cocoa app, I mean to say it doesn't use
standard widgets. Anyone who is experienced with Safari and Finder and other
native Mac apps, and tries out Firefox for Mac for the first time, will
notice almost instantly that Firefox is implementing things on their own.

Yes, there are benefits to writing your own controls, and going this route
has its own merits. For instance, you only need to write a text field once,
and it works on all platforms. But it also has drawbacks, such as *ahem* not
starting out with a working Responder Chain and potentially confusing plugin
authors, and possibly even newer users.

-Steven

On Mon, Mar 15, 2010 at 2:27 PM, Don Quixote de la Mancha 
quix...@dulcineatech.com wrote:

 On Mon, Mar 15, 2010 at 10:15 AM, Steven Degutis
 steven.degu...@gmail.com wrote:
  In my experience, Firefox (and thus
  probably other Mozilla apps) isn't even a native Cocoa app, it just
 pretends
  to be one, so I wouldn't doubt it if it doesn't even *have* a Responder
  Chain.

 I am quite certain that none of the Mozilla apps are Cocoa-native.
 They are all written using the Mozilla Cross-Platform Application
 Framework.  There is a book about how to write cross-platform apps
 with that framework.

 Any cross-platform framework ultimately has to call through to
 platform-specific APIs, but it's likely that it does so only in a very
 primitive, low-level way.

 Firefox plugins *should* be able to handle the clipboard just like any
 other user interface code.  But to do so, Firefox would need to
 provide the necessary support.  There's no reason it couldn't.  Either
 it just doesn't, or it tries to but it is buggy.

 Don Quixote
 --
 Don Quixote de la Mancha
 quix...@dulcineatech.com
 http://www.dulcineatech.com

   Dulcinea Technologies Corporation: Software of Elegance and Beauty.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Nil items in NSMutableSet

2010-03-16 Thread Steven Degutis
Daniel,

Method swizzling is fine for debugging purposes, but should not be used in
production code. This has already been said by some people who really,
really know what they're talking about.

And it's *very* dangerous to swizzle something on NSString. The first reason
(of many) that comes to mind, is that most of Apple's own internal
Objective-C frameworks are using NSStrings, in ways and situations you can't
predict. So by advising someone to mess with NSString's implementation, you
are advising them to potentially break their app in countless ways (possibly
even data-corrupting ones) and then send that app to unsuspecting users. Not
a great piece of advise, in my book.

-Steven

On Tue, Mar 16, 2010 at 6:34 PM, Daniel DeCovnick danhd...@mac.com wrote:

 There was a thread on this list a few days ago about effective method
 swizzling into Apple classes. Despite being replete with warnings about
 Don't use it in production code, it IS doable, and very, very cool, IMHO.

 -Dan


 On Mar 16, 2010, at 2:18 PM, Alejandro Rodriguez wrote:

  You were right, my equality is not transitive.

 id ob = [[objectClass alloc] initWithId:@hello];
 [ob isEqual:@hello]; //returns YES
 [@hello isEqual:ob]; //returns NO

 That may very well be the problem... now... I have no idea on how I will
 make the second test return YES.

 doesn't that depend on the implementation of isEqual of the asking object
 in this case NSString? Have any of you had to deal with this before? I'll
 dive into the docs and see what details I find that might be useful.

 Seems we are getting somewhere
 cheers!

 Alejandro

 On Mar 16, 2010, at 2:45 PM, Clark Cox wrote:

  On Tue, Mar 16, 2010 at 11:35 AM, Thomas Davie tom.da...@gmail.com
 wrote:

 Your code doesn't account for the possibility that the order of
 comparison might happen in the other order (i.e. [@123 isEqual:
 object]). I wouldn't be surprised if NSSet is assuming that equality
 is transitive (i.e. [a isEqual: b] == [b isEqual: a]).


 For reference, this property is not transitivity, the transitivity
 relation is:

 a - b ^ b - c = a - c (for some relation -)

 The one you're looking for is commutativity.


 Indeed; must have been echos of my previous life as a C++ programmer
 creeping into the Obj-C part of my brain (in C++, the std::set class
 uses less than, instead of equality, where transitivity is the
 important property, not commutativity).

 :)



 --
 Clark S. Cox III
 clarkc...@gmail.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/danhd123%40mac.com

 This email sent to danhd...@mac.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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: app window that doesn't deactive the current app

2010-03-16 Thread Steven Degutis
Please refer to this article:

http://stackoverflow.com/questions/1657659/cocoa-nsstatusbar-global-hotkey

=Steven

On Tue, Mar 16, 2010 at 3:16 PM, Martin Batholdy batho...@googlemail.comwrote:

 Hi,

 I would like to have a window that pops up via a shortcut.
 This window should be in background and the active app shouldn't get
 inactive.

 How is that possible?

 I have seen that in the Clips app (
 http://conceitedsoftware.com/products/clips ).


 thanks!___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Cut and paste out of/ into text fields in a separate window doesn't work

2010-03-15 Thread Steven Degutis
Not trying to be pessimistic here, just honest, but it seems like this is a
problem with Mozilla's (Firefox's? Thunderbird's? which app are we talking
about here?) plugin-architecture system.

The shortcuts Cmd+C and Cmd+V in the Edit menu link to the First Responder,
and typically any text field (NSTextField, NSSearchField, et al) which gets
focused, becomes the First Responder. Thus, it should Just Work™ like you
are expecting it to.

However, if the host app controlling your plugin is not giving your plugin a
chance to become first responder, it's most likely because said app is
completely breaking the Responder Chain. In my experience, Firefox (and thus
probably other Mozilla apps) isn't even a native Cocoa app, it just pretends
to be one, so I wouldn't doubt it if it doesn't even *have* a Responder
Chain.

You may want to contact the developers of the host app to ask them what's
going on, since they will have more intimate knowledge of their app's
uniqueness.

-Steven

On Mon, Mar 15, 2010 at 11:04 AM, Brian Postow brian.pos...@acordex.comwrote:

 I have a Mozilla plugin which puts up a separate window for login
 information.
 It seems to work fine, it gets keyboard events like typing and hitting
 return to hit the default button. HOWEVER, it doesn't seem to get cut
 and paste events. When I hit Cmd-v, the edit menu flashes, but nothing
 happnes.
 Is this a problem with my responder chain? Do I have to specially tell
 Mozilla that I want these events? or am I likely to have some other
 problem that I haven't even thought of?
 thanks.


 Brian Postow
 Senior Software Engineer
 Acordex Imaging Systems

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: death in dealloc

2010-03-13 Thread Steven Degutis
This is almost always caused by releasing an object earlier than you
expected to, and then trying to release it again later (similar to double
free). Look around in your class's code for a place where you autorelease
an ivar, but don't add it to a collection, or where you release an ivar but
don't set it to nil afterwards.

-Steven

On Sat, Mar 13, 2010 at 12:53 PM, Stuart Malin stu...@zhameesha.com wrote:

 I have some code that is throwing EXC_BAD_ACCESS. It does so when an object
 is deallocating, in its -dealloc method on a call to [super dealloc]. The
 object's class's superclass is NSObject. Here's the (relevant part of the)
 stack trace:

 #0  0x7fff872e016d in _class_hasCxxStructorsNoSuper
 #1  0x7fff872e0741 in object_cxxDestructFromClass
 #2  0x7fff872e60f8 in objc_destructInstance
 #3  0x7fff872e06f5 in _internal_object_dispose
 #4  0x7fff83e0279a in -[NSObject(NSObject) dealloc]
 #5  0x10007b18e in -[ZPOauthParams dealloc] at ZPOauthParams.m:57

 I know I must have blown something, but I have no idea what I could have
 done to cause this sort of problem. If anyone has seen something like this
 before, please let me in what direction I should look for the problem. TIA.

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Bison/Yacc with Objective-C ?

2010-03-12 Thread steven Hooley
 Bloomin' magic! Thanks, Filip, it worketh well. Hardy souls all.
 Tom W.

Is it possible to see an example of how this might be used? I'd like
to understand Bison/Yacc better and i think an example relevant to
Cocoa / Objective-C would really help.

Thanks,
Steven
___

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: WebView refresh problem

2010-03-09 Thread Steven Degutis
The problem you're describing isn't very clear to me. Can you be more
specific as to what the unexpected result is, and what action you're taking
that triggers this unexpected result? And, last but certainly not least,
what is the actual code you are using to load a new page into the WebView?
Thanks.

-Steven

On Tue, Mar 9, 2010 at 7:26 AM, Arun arun...@gmail.com wrote:

 Hi All

 I have an application which has a single window with a webview inside it.
 When the application starts it starts a background thread from which i will
 be feeding different HTML files using performSelectorOnMainThread:.
 Everything works fine.

 The problem is when the application is launched, if i click on apple icon
 or
 the Application menu items in the Apple menu bar, when the background
 thread
 loads a different HTML page, instead of webview refresh, the new HTML is
 getting over lapped on the previous HTML page.

 How can the overlapping be avoided?

 Thanks
 Arun KA
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Is kCAOnOrderOut too good to be true?

2010-03-09 Thread Steven Degutis
Not yet; still asking everyone I know and hoping a Core Animation wizard
comes across this thread.

-Steven


On Tue, Mar 9, 2010 at 2:49 PM, Jon Buffington li...@jon.buffington.namewrote:

 Steven,

 Did you ever find a solution to the kCAOnOrderOut animation problem? I was
 frustrated by this problem in the past but gave up as the animation was
 optional.

 Regards,
 Jon

 On Mar 6, 2010, at 11:01 PM, Steven Degutis wrote:

  This seems to suggest that the presentation layer has something to do
 with
  solving this issue, if it can be solved at all (and I'm hopeful that it
 can;
  I doubt Apple would have created kCAOnOrderOut solely to be broken from
 the
  start, and never fix it).
 
  But from everyone I've talked to, no one has a clue how to make the
  animation given for the kCAOnOrderOut key actually animate visibly on
  screen, either before the layer has been removed from its superlayer, or
  afterwards, once -removeFromSuperlayer has been called.
 
  If anyone can provide a solution to actually showing the animation
 returned
  given kCAOnOrderOut, it would be appreciated.
 
  -Steven
 
  On Sat, Mar 6, 2010 at 7:18 PM, Kyle Sluder kyle.slu...@gmail.com
 wrote:
 
  On Sat, Mar 6, 2010 at 3:08 PM, Steven Degutis 
 steven.degu...@gmail.com
  wrote:
  I've been reading the docs for Core Animation, specifically about
  layer-actions, and it mentions a constant called kCAOnOrderOut which is
  supposedly called when your layer is removed from its superlayer (or
  hidden). However, if it's removed from superlayer, the animation
 returned
  for the kCAOnOrderOut event is apparently ignored, because the layer is
  removed immediately, instead of when the animation finishes. The docs
  practically declare that this is meant for animations. So, what gives?
 Is
  this too good to be true? Do I need to use the workaround of adding the
  animation, and in the didStop delegate, removing the layer myself? Code
  would be so much cleaner if just calling -removeFromSuperlayer would
  invoke
  the animation for me and then remove it itself...
 
  Isn't this an artifact of dealing with the model layer? I would expect
  that as far as my code is concerned, the sublayer is removed from its
  parent layer immediately, because I'm only dealing with the model
  layer tree, not the presentation layer tree.
 
  --Kyle Sluder
 
 
 
 
  --
  Steven Degutis
  http://www.thoughtfultree.com/
  http://www.degutis.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/lists%40jon.buffington.name
 
  This email sent to li...@jon.buffington.name




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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


Is kCAOnOrderOut too good to be true?

2010-03-06 Thread Steven Degutis
Hi all,

I've been reading the docs for Core Animation, specifically about
layer-actions, and it mentions a constant called kCAOnOrderOut which is
supposedly called when your layer is removed from its superlayer (or
hidden). However, if it's removed from superlayer, the animation returned
for the kCAOnOrderOut event is apparently ignored, because the layer is
removed immediately, instead of when the animation finishes. The docs
practically declare that this is meant for animations. So, what gives? Is
this too good to be true? Do I need to use the workaround of adding the
animation, and in the didStop delegate, removing the layer myself? Code
would be so much cleaner if just calling -removeFromSuperlayer would invoke
the animation for me and then remove it itself...

-Steven
___

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: Is kCAOnOrderOut too good to be true?

2010-03-06 Thread Steven Degutis
This seems to suggest that the presentation layer has something to do with
solving this issue, if it can be solved at all (and I'm hopeful that it can;
I doubt Apple would have created kCAOnOrderOut solely to be broken from the
start, and never fix it).

But from everyone I've talked to, no one has a clue how to make the
animation given for the kCAOnOrderOut key actually animate visibly on
screen, either before the layer has been removed from its superlayer, or
afterwards, once -removeFromSuperlayer has been called.

If anyone can provide a solution to actually showing the animation returned
given kCAOnOrderOut, it would be appreciated.

-Steven

On Sat, Mar 6, 2010 at 7:18 PM, Kyle Sluder kyle.slu...@gmail.com wrote:

 On Sat, Mar 6, 2010 at 3:08 PM, Steven Degutis steven.degu...@gmail.com
 wrote:
  I've been reading the docs for Core Animation, specifically about
  layer-actions, and it mentions a constant called kCAOnOrderOut which is
  supposedly called when your layer is removed from its superlayer (or
  hidden). However, if it's removed from superlayer, the animation returned
  for the kCAOnOrderOut event is apparently ignored, because the layer is
  removed immediately, instead of when the animation finishes. The docs
  practically declare that this is meant for animations. So, what gives? Is
  this too good to be true? Do I need to use the workaround of adding the
  animation, and in the didStop delegate, removing the layer myself? Code
  would be so much cleaner if just calling -removeFromSuperlayer would
 invoke
  the animation for me and then remove it itself...

 Isn't this an artifact of dealing with the model layer? I would expect
 that as far as my code is concerned, the sublayer is removed from its
 parent layer immediately, because I'm only dealing with the model
 layer tree, not the presentation layer tree.

 --Kyle Sluder




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Uninitialized rectangle??

2010-03-04 Thread Steven Degutis
Are you sure that your NSStatusBar or NSStatusItem instances are nil, and
not just what's returned from -view? I see no reason that it should be nil,
and no proof that it is. (To be fair, I only skimmed this mess of a thread.)

-Steven

On Thu, Mar 4, 2010 at 12:05 PM, fabian cocoadevl...@gmail.com wrote:

 On Thu, Mar 4, 2010 at 5:28 PM, Jens Alfke j...@mooseyard.com wrote:

 
  On Mar 4, 2010, at 12:42 AM, fabian wrote:
 
   Right. But why should it matter? The system status bar is not in the
 nib.
  Just curious about what is going on behind the scenes...
 
  The status bar is in the menu bar, and the menu bar is in the same nib as
  your app controller. The status bar probably initializes itself in an
  -awakeFromNib method. Whether that method runs before or after your
  -awakeFromNib method is completely unpredictable.
 
   I can see why it's a bad thing in theory, but I haven't had any
 problems
  with this approach.
 
  Are you prepared to have your app crash and burn on launch for every user
  that installs some upcoming OS revision (perhaps even a minor update)?
 I'm
  serious; this happens. Doing things that shouldn't work, just because
 they
  do work at the moment, is asking for trouble since the underlying
 behavior
  of the system frameworks can change in the future.
 
  (This is especially painful if you're not on the expen$ive Apple
 developer
  plans that get you access to OS betas, because that means you won't get a
  chance to find any of these crashes before your customers do. Instead you
  find yourself frantically debugging on the day the new OS comes out,
 while
  your mailbox fills up with crash reports and complaints.)
 
   Anyway, back to subject. Perhaps a better approach than using timers,
  guesswork and voodoo, would be to check the validity of the frame rect
 and,
  if it's zero or garbage, make my own rectangle.
 
  Um, no. Check whether the status bar is nil before you ask for its frame,
  instead of working around the aftermath of calling a struct accessor on
 nil.
  But doing this is still a hack, for the reason I described above. It's
  pretty clear that you shouldn't be doing anything with NSStatusBar in an
  -awakeFromNib method in the main nib.
 
  —Jens


 But this is not in -awakeFromNib. That's the whole problem :)

 It's in -applicationDidFinishLaunching. Which works great on all systems
 (as
 far as I know), except for on 10.5.8 where NSStatusBar is still nil at this
 point. That's what I'm trying to find a work-around for.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Uninitialized rectangle??

2010-03-04 Thread Steven Degutis
Right. Have you tried the solution I proposed in the /very first reply/ to
this thread?

-Steven

On Thu, Mar 4, 2010 at 1:05 PM, fabian cocoadevl...@gmail.com wrote:

 On Thu, Mar 4, 2010 at 6:50 PM, Steven Degutis 
 steven.degu...@gmail.comwrote:

 Are you sure that your NSStatusBar or NSStatusItem instances are nil, and
 not just what's returned from -view? I see no reason that it should be nil,
 and no proof that it is. (To be fair, I only skimmed this mess of a thread.)

 -Steven


 No, I'm not. It just boiled down to this assumption along the way somehow.
 Perhaps to make the thread less messy :)

 But you are absolutely right: all I know for sure is that whatever is
 returned from [view frame] is causing the unitialized rectangle assertion
 failure.



 On Thu, Mar 4, 2010 at 12:05 PM, fabian cocoadevl...@gmail.com wrote:

  On Thu, Mar 4, 2010 at 5:28 PM, Jens Alfke j...@mooseyard.com wrote:

 
  On Mar 4, 2010, at 12:42 AM, fabian wrote:
 
   Right. But why should it matter? The system status bar is not in the
 nib.
  Just curious about what is going on behind the scenes...
 
  The status bar is in the menu bar, and the menu bar is in the same nib
 as
  your app controller. The status bar probably initializes itself in an
  -awakeFromNib method. Whether that method runs before or after your
  -awakeFromNib method is completely unpredictable.
 
   I can see why it's a bad thing in theory, but I haven't had any
 problems
  with this approach.
 
  Are you prepared to have your app crash and burn on launch for every
 user
  that installs some upcoming OS revision (perhaps even a minor update)?
 I'm
  serious; this happens. Doing things that shouldn't work, just because
 they
  do work at the moment, is asking for trouble since the underlying
 behavior
  of the system frameworks can change in the future.
 
  (This is especially painful if you're not on the expen$ive Apple
 developer
  plans that get you access to OS betas, because that means you won't get
 a
  chance to find any of these crashes before your customers do. Instead
 you
  find yourself frantically debugging on the day the new OS comes out,
 while
  your mailbox fills up with crash reports and complaints.)
 
   Anyway, back to subject. Perhaps a better approach than using timers,
  guesswork and voodoo, would be to check the validity of the frame rect
 and,
  if it's zero or garbage, make my own rectangle.
 
  Um, no. Check whether the status bar is nil before you ask for its
 frame,
  instead of working around the aftermath of calling a struct accessor on
 nil.
  But doing this is still a hack, for the reason I described above. It's
  pretty clear that you shouldn't be doing anything with NSStatusBar in
 an
  -awakeFromNib method in the main nib.
 
  —Jens


 But this is not in -awakeFromNib. That's the whole problem :)

 It's in -applicationDidFinishLaunching. Which works great on all systems
 (as
 far as I know), except for on 10.5.8 where NSStatusBar is still nil at
 this
 point. That's what I'm trying to find a work-around for.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




 --
 Steven Degutis
 http://www.thoughtfultree.com/
 http://www.degutis.org/





-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Uninitialized rectangle??

2010-03-04 Thread Steven Degutis
NSStatusItem's -view and -setView: methods are related to your own custom
view, and have nothing to do with the view it internally uses. Thus, it
initially has no view until you give it one. So, giving it a dummy view via
[statusItem setView: [[[NSView alloc] init] autorelease] ] is going to allow
you to access that view's -window and thus the -frame of the NSWindow. Keep
in mind though that this is a hack, and also usually very unnecessary and
bad and against the HIG in the first place.

-Steven

On Thu, Mar 4, 2010 at 2:01 PM, fabian cocoadevl...@gmail.com wrote:

 On Thu, Mar 4, 2010 at 7:47 PM, Steven Degutis 
 steven.degu...@gmail.comwrote:

 Right. Have you tried the solution I proposed in the /very first reply/ to
 this thread?

 -Steven


 Actually, no. I don't have 10.5.8, so I would have to send it to one of the
 end-users to try, and I feel hesitant to bother a customer without having a
 clue _why_ the changes made to the code would make any difference. I did
 send you a reply, though, asking why you think feeding a dummy view to the
 status item would give better results. I'm not questioning your suggestion,
 I'd just like to hear the arguments for it before proceeding.



 On Thu, Mar 4, 2010 at 1:05 PM, fabian cocoadevl...@gmail.com wrote:

 On Thu, Mar 4, 2010 at 6:50 PM, Steven Degutis steven.degu...@gmail.com
  wrote:

 Are you sure that your NSStatusBar or NSStatusItem instances are nil,
 and not just what's returned from -view? I see no reason that it should be
 nil, and no proof that it is. (To be fair, I only skimmed this mess of a
 thread.)

 -Steven


 No, I'm not. It just boiled down to this assumption along the way
 somehow. Perhaps to make the thread less messy :)

 But you are absolutely right: all I know for sure is that whatever is
 returned from [view frame] is causing the unitialized rectangle assertion
 failure.



  On Thu, Mar 4, 2010 at 12:05 PM, fabian cocoadevl...@gmail.comwrote:

  On Thu, Mar 4, 2010 at 5:28 PM, Jens Alfke j...@mooseyard.com
 wrote:

 
  On Mar 4, 2010, at 12:42 AM, fabian wrote:
 
   Right. But why should it matter? The system status bar is not in
 the nib.
  Just curious about what is going on behind the scenes...
 
  The status bar is in the menu bar, and the menu bar is in the same
 nib as
  your app controller. The status bar probably initializes itself in an
  -awakeFromNib method. Whether that method runs before or after your
  -awakeFromNib method is completely unpredictable.
 
   I can see why it's a bad thing in theory, but I haven't had any
 problems
  with this approach.
 
  Are you prepared to have your app crash and burn on launch for every
 user
  that installs some upcoming OS revision (perhaps even a minor
 update)? I'm
  serious; this happens. Doing things that shouldn't work, just because
 they
  do work at the moment, is asking for trouble since the underlying
 behavior
  of the system frameworks can change in the future.
 
  (This is especially painful if you're not on the expen$ive Apple
 developer
  plans that get you access to OS betas, because that means you won't
 get a
  chance to find any of these crashes before your customers do. Instead
 you
  find yourself frantically debugging on the day the new OS comes out,
 while
  your mailbox fills up with crash reports and complaints.)
 
   Anyway, back to subject. Perhaps a better approach than using
 timers,
  guesswork and voodoo, would be to check the validity of the frame
 rect and,
  if it's zero or garbage, make my own rectangle.
 
  Um, no. Check whether the status bar is nil before you ask for its
 frame,
  instead of working around the aftermath of calling a struct accessor
 on nil.
  But doing this is still a hack, for the reason I described above.
 It's
  pretty clear that you shouldn't be doing anything with NSStatusBar in
 an
  -awakeFromNib method in the main nib.
 
  —Jens


 But this is not in -awakeFromNib. That's the whole problem :)

 It's in -applicationDidFinishLaunching. Which works great on all
 systems (as
 far as I know), except for on 10.5.8 where NSStatusBar is still nil at
 this
 point. That's what I'm trying to find a work-around for.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




 --
 Steven Degutis
 http://www.thoughtfultree.com/
 http://www.degutis.org/





 --
 Steven Degutis
 http://www.thoughtfultree.com/
 http://www.degutis.org/





-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/
___

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

Please do not post admin requests or moderator comments to the list.
Contact

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 only get a value relative to the view's
superview, so that'll be useless too.

-Steven

On Wed, Mar 3, 2010 at 2:23 PM, fabian cocoadevl...@gmail.com wrote:

 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 = [[MyStatusItemView alloc]
 initWithFrame:frameRect];
 [theView setDelegate:self];
 [statusItem setView:theView];
 [theView release];

 I didn't think much about it then - I simply moved the code to
 applicationDidFinishLaunching and everything was fine. But now I'm
 told the app is crashing nevertheless, AFAIK under 10.5.8 only:

 3/2/10 3:12:49 PM MyProcess[13261] *** Assertion failure in
 -[MyStatusItemView initWithFrame:],
 /SourceCache/AppKit/AppKit-
 949.54/AppKit.subproj/NSView.m:1099
 3/2/10 3:12:49 PM MyProcess[13261] Uninitialized rectangle passed to
 [View initWithFrame:].
 3/2/10 3:13:38 PM com.apple.launchd[115]
 ([0x0-0x104104].my.process[13261]) Exited abnormally: Interrupt

 It's definitely related to the app/nib not being up and ready to go.
 I'm displaying a dialog on first run in awakeFromNib. When the dialog
 is displayed (delaying the execution of this code), it works fine. On
 second launch it's a no go.

 How can the system status bar not be initialized at this point? It's
 not even part of the nib...

 Thanks.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: what is a bindings pattern to check for a non-empty selection?

2010-03-02 Thread Steven Degutis
Just wanted to update everyone on this issue; I've done some experimentation
with this, and I've found that binding to selection with NSIsNotNil
transformer does not reliably work, but binding to selectedobjec...@count
does work. (And by work I mean be disabled when the table has no
selection, and enabled when it has any selection at all.)

-Steven

On Fri, Feb 19, 2010 at 7:04 AM, Joanna Carter 
cocoa...@carterconsulting.org.uk wrote:

 Le 19 févr. 2010 à 11:02, Jean-Denis Muys a écrit :

  I am looking for a way to enable a button in my window only if some
 selection has been made in the data. Currently the data is shown in a table
 view and is handled through an NSArrayController. I am trying to bind the
 button's Enabled property to the ArrayController so that I get whether
 something is selected (multiple selections allowed).

 I bind the enabled property to the selection but using the NSIsNotNil value
 transformer.

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Windows and nibs and dialogs, oh my!

2010-03-02 Thread Steven Degutis
Few simple steps:

(1) Create a subclass of NSWindowController and override -init to call
super's -initWithWindowNibName:, passing something like @MyWindow
(2) Create a XIB file with the filename called MyWindow
(3) Change File's Owner to your recent subclass
(4) Connect the -window outlet of your subclass to the NSWindow in the XIB
file
(5) Instantiate your subclass somewhere and either access -window directly
or call -showWindow: (which is what I usually do)

-Steven

On Tue, Mar 2, 2010 at 9:13 PM, William Squires wsqui...@satx.rr.comwrote:

 Please help, I'm still a bit fuzzy on how to open a window in Cocoa/ObjC. I
 realize there's a correlation between a nib, the window you design(ed) in
 IB, and the .h/.m files for the controller class, but how do you actually
 USE this stuff? i.e. If I wanted to make a window in REALbasic, I would
 design the window's UI, put in a publicly accessible Display() method that
 did something like:

 Public Sub Display()
  // Setup control's states based on available info (this window's class'
 properties)
  Me.Setup()

  // This is a modal window to allow the player to roll a new
 player-character
  Me.ShowModal()
 End Sub

 Then, somewhere else, I would do:

 Dim w As wndRollNewPC
 Dim theNewPC As PlayerChar

 theNewPC = nil
 w = New wndRollNewPC()
 w.DefaultPlayerName = untitled PC
 w.UseDefaultRules = True
 w.Display()
 theNewPC = w.NewPC
 w = nil
 If (theNewPC = nil) Then
  // Player somehow aborted
  Exit Sub
 End If
 ...


 And the call w.Display() would make the window visible and frontmost (or,
 in Cocoa terms, it would load the nib, then - somehow - make it (the window,
 not the nib!) visible, and set one of the controls to be FirstResponder. It
 would also hook up the FilesOwner proxy object reference.)
  What I want to know is how to get this bit of magic to work? Am I going to
 have to chant arcane phrases over my keyboard while moving my mouse just so?
 :) This gets even more confusing on the iPhone, BTW.


 A compiler is a tool for turning source code into error messages;
 generating machine language bytes is just a fortuitous by-product!

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Forcing the package bit

2010-03-01 Thread Steven Degutis
I believe this can be accomplished by exporting a new UTI that describes
your package type (probably by extending com.apple.package or something like
that). This would be done inside your app's Info.plist file.

-Steven

On Mon, Mar 1, 2010 at 8:14 PM, Graham Cox graham@bigpond.com wrote:

 I need to write a package file that is not listed as one of my document
 types. How do I ensure that this will be seen as a package in the Finder? It
 looks to me as though some new flags were added to NSURL to cover this but
 the code needs to work on 10.5 or later.

 --Graham


 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: NSForegroundColorAttributeName without AppKit

2010-03-01 Thread Steven Degutis
NSAttributedString is part of Foundation.framework and so are all NSStrings
(including literal constants like @NSColor). Thus, you can use that safely
without linking against AppKit.framework; however, I advise against using
string literals in place of Apple's constants, since they might change under
your nose.

-Steven

On Mon, Mar 1, 2010 at 10:27 PM, BareFeet list.develo...@tandb.com.auwrote:

 Thanks Graham for your reply:

  I have some working code for adding attributes to a string. I'd like to
 modify it so it will work without needing AppKit. I can get it all going
 except the NSForegroundColorAttributeName constant which seems to only exist
 in AppKit.
 
  If you log the actual value of that constant, it's simply @NSColor.

 Unfortunately it seems that using the @NSColor key as part of an
 NSAttributedString also requires AppKit. Put another way, I can't see any
 way to draw multi-colored text in a wrapping text field without using
 AppKit.

 Thanks,
 Tom
 BareFeet

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Webview and dynamic content

2010-02-27 Thread Steven Degutis
Store them in your app's bundle.

Related, if you want my 2¢, try as often as you can to avoid using a
WebView. If you can replace its functionality with native Cocoa (and Touch)
controls then that is the recommended development path.

-Steven

On Sat, Feb 27, 2010 at 5:39 AM, Jere Gmail zon7m...@gmail.com wrote:

 Hi there,
 I'm developing an app that relies on a webpage. This page has to load
 local files (json or xml) that i save on the hard drive.
 What's the better way to implement it. I've think two options: save
 the json files in the app resources folder, same way iPhoto stores the
 files. Or save them in the app support directory.
 The second way round I have to move the web to this folder in order to
 let javascript load the local files.
 Which one is better as I plan to port the app to OSX and iPhone.

 --
 Infinity is only the beginning π
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: NSButton and NSEvent

2010-02-27 Thread Steven Degutis
First of all, you may want to look into NSMatrix to accomplish this task
instead of using individual NSButtons, both for performance reasons and
(more importantly) to use the Cocoa API as it is intended (this is why
NSMatrix was created, so it handles this relatively well).

Secondly, if you use NSMatrix, or even NSTableView (which may be a better
layout in this case), you can populate the items programmatically. Thus, you
can have an array of model objects representing the data, with properties
such as userVisibleTitle and representedCommandLineOptionString or
something to that effect (and possibly an ID property too if need be, but
probably not). Then you could supply these to the views rather easily, and
readily fetch and display any property for a given object. Read more about
this in the MVC section of Apple's docs.

Also, regarding your feature to toggle the display between power users and
normal users, there's a few options. You could do this via tooltips, or
you could have an option to choose to display the normal titles versus the
command line options. But keep in mind, power users will probably prefer the
command line anyway, usually. So I wouldn't put too much thought into this.

-Steven

On Sat, Feb 27, 2010 at 8:46 AM, Jeremy Matthews jeremymatth...@mac.comwrote:

 So I have a application that I am getting ready to put some finishing
 touches on, but there are one or two things I'd like to do differently...er,
 better.

 It is a simple tool (Cocoa Desktop app) with a slew of checkboxes (around
 40 in a separate window) that act as parameters on a command. While I show
 the user-friendly wording yard work, behind the scenes I actually use
 parameters like -lawngeneral (if that checkbox is selected it does a check
 and provides the internal naming scheme when it builds the full command).
 Since the latter are part of the internal logic (and affect other systems),
 they cannot be changed at this time. But, I would like to be able to give
 those nsbuttons a second property that does not change depending on
 selection (so, alternateTitle would not work), just to make life easier when
 referencing said items. In NSMenu land, someone mentioned using
 setRepresentedItems, which worked great in my needs there...is there a
 similar feature for NSButton (specifically checkboxes)?

 Also, it would be nice if I could intercept an nsevent that changed their
 text from the user-friendly version to the internal logic titles - if only
 for some better understanding by power users (like, holding down the option
 key at any point in time). I've mucked around with some examples, but it
 seems like most depend on a a specific method and not silently observing in
 the background, like clicking on a button.

 How would you handle the first request, create a dictionary, or is there
 another method I missed?
 And the second, I'm not even sure..

 Any ideas?

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: NSMenuItem Action

2010-02-27 Thread Steven Degutis
Generally connecting them in IB works just fine. Sometimes this won't be
possible, though, and you should use code to do that (like when creating
items in code). But, keep in mind that the First Responder is in every NIB
file, and works amazingly when you have a menu item that exists in a NIB,
and know what action it sends, but do NOT know what target it sends it to
until runtime. Read more about First Responder in Apple's docs, naturally.

-Steven's 2¢

On Sat, Feb 27, 2010 at 2:40 PM, David Blanton aired...@tularosa.netwrote:

 What is the best practice for connecting menu items to their actions?

 Is it IB, is programatically?

 If IB what is the process?

 - db

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: How to get my application version from inside my code?

2010-02-27 Thread Steven Degutis
This is already shown in the default About box window, which is sufficient
for most apps. But if you really need to have your own custom About box, you
can get most of that information from
-[NSBundle objectForInfoDictionaryKey:]

-Steven

On Sat, Feb 27, 2010 at 4:21 PM, Bengt Nilsson bengt.nilsso...@spray.sewrote:

 Hi!

 I need to access the bundle version of my application from inside my code
 to show it in the About.. box.
 How can I do this?

 BN

  ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: NSViewAnimation vs Distributed Notification: Bug?

2010-02-27 Thread Steven Degutis
Firstly, you do not need to check if tAnimation is nil, since sending a
message to nil is valid in ObjC. So I would personally remove that if() and
just de-indent all the code that's inside it.

Secondly, I *think* what you're running into is the fact that blocking
mode means the main thread blocks, and thus does not receive any
distributed notifications. The second snippet of code (the one that works
fine) does not animate on the main thread, thus everything works correctly.

If you want to use NSViewAnimation for some reason (but I wouldn't), then
you can change the mode away from blocking-mode to something more
background-thread-y.

-Steven

On Sat, Feb 27, 2010 at 6:24 PM, Iceberg-Dev dev.iceb...@gmail.com wrote:

 [Q] Is there a known bug in NSViewAnimation on Mac OS X 10.4 when it comes
 to Distributed Notifications?

 Scenario:
 -

 If I animate a window resizing through a NSViewAnimation, some Distributed
 Notifications are only taken into account after I click in the window
 resized through a NSViewAnimation.

 If I animate the window with setFrame:dispplay:animate:, the problem does
 not occur.

 ---8---8---8---8---8---8---8---

 // This does not work correctly

 tAnimationDictionary=[NSDictionary
 dictionaryWithObjectsAndKeys:IBwindow_,NSViewAnimationTargetKey,
[NSValue
 valueWithRect: tNewWindowFrame], NSViewAnimationEndFrameKey,
nil];

 tAnimation=[[NSViewAnimation alloc] initWithViewAnimations: [NSArray
 arrayWithObject:tAnimationDictionary]];

 if (tAnimation!=nil)
 {
[tAnimation setAnimationBlockingMode:NSAnimationBlocking];

[tAnimation setDuration: 0.15f];

[tAnimation startAnimation];

[tAnimation autorelease];
 }

 // This works fine

 [IBwindow_ setFrame:tNewWindowFrame display:YES animate:YES];


 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Setting parent window

2010-02-26 Thread Steven Degutis
Hi Gaurav,

Welcome to Cocoa development! It's fun, and very rewarding. Regarding your
question, you really will want to avoid taking Windows design patterns (for
both development and user experience) into a Mac app. Not only is what
you're trying to accomplish not possible, but it's a really bad user
experience to have a modal window when one is not required. Please look into
reading Apple's documents called the Human Interface Guidelines, your users
(and fellow developers on this list) will really appreciate it.

-Steven


On Thu, Feb 25, 2010 at 7:38 PM, Gaurav Srivastava
gauravwin...@gmail.comwrote:

 Is there any corresponding function call for ::SetParent(in Windows) in
 Cocoa?
 Basically I have a parent application from which I have to launch another
 application. I want the child application to open as modal within the
 parent
 application and not as a separate application.
 I have the window handles of both applications.
 I tried using [NSWindow setParentWindow] but this was not working for me.

 Is there any possible solution?

 --
 Gaurav Srivastava
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Removing quit button from dock menu

2010-02-24 Thread Steven Degutis
Generally, Cocoa developers do not write installers, but instead use
PackageMaker to install our apps for us. If it's not software you're
installing then, well, I don't know what to tell you. But you still can't
stop the user from quitting your app. If they really want to, they can quit
it from the Dock in 2 ways (Quit or Force Quit).

The recommended first step is to read the Human Interface Guidelines on what
an app should and should not do. If you read and follow the HIG, your users
will like you a lot better.

-Steven

On Wed, Feb 24, 2010 at 4:20 AM, yogin bhargava bhargavayo...@gmail.comwrote:

 Hi All,
Thanks for your responses. The application is an installer which has to
 install something. And that installer should not be allowed to quit.

 Thanks,
 YOGIN

 On Wed, Feb 24, 2010 at 12:32 AM, Mark Ritchie mark.ritc...@mac.com
 wrote:

  Hi Yogin!
 
  On 22/Feb/2010, at 10:33 PM, yogin bhargava wrote:
   I dont want to allow the user to quit my application except from the
  activity monitor.
  Ok, I'm curious, in what circumstance would this workflow be obvious to
 the
  user of your application?  I know that personally, I would be secure
  deleting any application which worked this way however that's just my
  opinion. ;-)
 
   I have removed the controls for apple+Q button and menu option. Dock
 item
  is the only thing left.
 
  And what about the other ways to terminate an application?
  For example, the force quit menu?
 
  It sounds me to that you might be developing an application which isn't
  intended to have a user interface?  Is that the case?  If so, then
 perhaps
  this isn't the best approach...
  M.
 



 --
 YOGIN BHARGAVA,
 Flat No TF-2,
 Phase 4,
 Lotus Krest,
 Kundalahalli Colony,
 ITPL Main Road,
 Bangalore-560067
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Help with creating CustomViews

2010-02-23 Thread Steven Degutis
You're on the right track with NSViewController. Make an NSViewController
and a XIB specifically for this view controller. Set the -view outlet in
your NIB and make sure you name the File's Owner the same as your
NSViewController subclass. Make sure your initializer mentions the name of
the correct XIB it requires. Then, in the rest of your code, instantiate
your NSViewController subclass and ask for its NSView via the -view
accessor. Add the NSView anywhere you want. I often do this by using an
NSBox and using -setContentView:

-Steven

On Fri, Feb 19, 2010 at 4:20 PM, Jean-Henri Duteau
duteaudes...@gmail.comwrote:


 On 2010-02-19, at 6:55 AM, Steven Degutis wrote:

  It sounds a lot to me (and I could be wrong here) that you're trying to
 implement something along the lines of an ActiveX control as they were back
 when I used Visual Basic 5, in the sense that you want a control which is
 really a collection of other controls, and to be able to drag them around in
 IB and treat this collection as if they were a single control.
 
 That's exactly what I want - a control which can be dragged around in IB
 and, more importantly, created a number of times.  I want View that I can
 place on a window (or anywhere in IB) along a view controller.  I can then
 point the controller at the model and everything will just work.


  What you're doing can easily be accomplished in code, by having an
 NSViewController that points to your own XIB file, and by creating instances
 of this view controller and inserting its view into other views. This is the
 canonical way. Not only do you get more flexibility by doing it in code (and
 a lot less repetition in IB) but this method allows you to encapsulate
 another level of abstractness inside your NSViewController subclass, thus
 cleaning up your code (a lot). This is what more experienced Cocoa coders
 generally do instead of what you're trying to do.
 
 I'm sure that it can and that's exactly what my first try did - I have a
 custom NSViewController that points to my view's XIB file.  I then added an
 instance of my view controller.  The problem is that I'm stuck from there -
 I'm unsure how to get the view to appear where I want it to on the window.
  I've added a Custom View in the layout and set its class to my view's
 class.  I attach the view to the view controller.  And nothing happens and
 I'm unsure what to override or call to make it happen.

 Jean___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Removing quit button from dock menu

2010-02-23 Thread Steven Degutis
As I mentioned before, doing this is not supported by Apple. What kind of
app are you creating, and why exactly are you under the belief that users
must not be able to quit it from the Dock?

-Steven

On Tue, Feb 23, 2010 at 1:33 AM, yogin bhargava bhargavayo...@gmail.comwrote:

 I dont want to allow the user to quit my application except from the
 activity monitor. I have removed the controls for apple+Q button and menu
 option. Dock item is the only thing left.

 On Mon, Feb 22, 2010 at 9:15 PM, Mark Ritchie mark.ritc...@mac.com
 wrote:

  On 21/Feb/2010, at 10:52 PM, yogin bhargava wrote:
I have an application for which I have to remove quitting option.
   Anybody has idea how to remove it from the dock menu.
 
  What is the goal?  Why would you want to do this?
  M.
 



 --
 YOGIN BHARGAVA,
 Flat No TF-2,
 Phase 4,
 Lotus Krest,
 Kundalahalli Colony,
 ITPL Main Road,
 Bangalore-560067
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Removing quit button from dock menu

2010-02-22 Thread Steven Degutis
This is not supported because users should be able to quit any app they
choose. However, if your app is a Kiosk app, then there are other
measurements you can take to make sure it runs in Kiosk mode. Look in
Apple's docs for kiosk mode for more details.

-Steven

On Mon, Feb 22, 2010 at 1:52 AM, yogin bhargava bhargavayo...@gmail.comwrote:

 Hi everyone,
  I have an application for which I have to remove quitting option.
 Anybody has idea how to remove it from the dock menu.

 Thanks,
 --
 YOGIN BHARGAVA,
 Flat No TF-2,
 Phase 4,
 Lotus Krest,
 Kundalahalli Colony,
 ITPL Main Road,
 Bangalore-560067
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: what is a bindings pattern to check for a non-empty selection?

2010-02-19 Thread Steven Degutis
I too have been wondering how others approach this issue. For a long time I
used canRemove and eventually switched to using my own value transformer
which does the heavy lifting for me. But it's quite tedious to include this
value transformer in every project I write which uses bindings like this, so
I've been looking for a built-in alternative. So now I'm wondering if
selectedobjec...@count is a good alternative. Have yet to try it, but it
looks viable.

-Steven

On Fri, Feb 19, 2010 at 8:27 AM, Ken Thomases k...@codeweavers.com wrote:

 On Feb 19, 2010, at 7:15 AM, Jerry Krinock wrote:

  On 2010 Feb 19, at 03:02, Jean-Denis Muys wrote:
 
  I have tried bindings to selectedObjects using the model key count, as
 a non zero count is obviously compatible with the BOOL that the property
 expects. But this doesn't work: I get an error message:
 
  Cannot create BOOL from object () of class __NSArray0
 
  It means that it wants a BOOL but the selectedObjects you're giving it is
 an array.

 Did you try the @count KVC operator?

 http://developer.apple.com/mac/library/documentation/cocoa/conceptual/KeyValueCoding/Concepts/ArrayOperators.html

 Using the model key count to an array property (selectedObjects) builds a
 new array containing the results of invoking valueForKey:@count to each
 element of selectedObjects, which isn't what you meant.

 Regards,
 Ken

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Help with creating CustomViews

2010-02-19 Thread Steven Degutis
It sounds a lot to me (and I could be wrong here) that you're trying to
implement something along the lines of an ActiveX control as they were back
when I used Visual Basic 5, in the sense that you want a control which is
really a collection of other controls, and to be able to drag them around in
IB and treat this collection as if they were a single control.

While it is possible using IB Plugins, that's not really what IB's plugin
system was intended for. This plugin system was meant more for control that
are actually custom, such as a WebView object or PDFView or IKImageView or
ABPeoplePickerView. (These are all custom classes which Apple has included
into IB via its own default set of plugins.) This is to say, the plugin
system is intended for actual subclasses of NSView or NSControl (or NSCell)
which implement very specific and unique behavior, and where it's important
(or at least desired by management) to be able to set their settings in IB
during design-time.

What you're doing can easily be accomplished in code, by having an
NSViewController that points to your own XIB file, and by creating instances
of this view controller and inserting its view into other views. This is the
canonical way. Not only do you get more flexibility by doing it in code (and
a lot less repetition in IB) but this method allows you to encapsulate
another level of abstractness inside your NSViewController subclass, thus
cleaning up your code (a lot). This is what more experienced Cocoa coders
generally do instead of what you're trying to do.

-Steven

On Mon, Feb 15, 2010 at 9:19 PM, Jean-Henri Duteau
duteaudes...@gmail.comwrote:

 Hi all,

 I'm a newcomer when it comes to Cocoa development.  I have some good books
 and they discuss the possibility of CustomViews but the views they create
 aren't the type that I'm interested.  I've scoured the web and haven't found
 exactly the help I need and I've tried the trial-and-error method and it
 hasn't worked.

 What I'm trying to do is the following:
 -I have a number of model objects, different instances of the same class.
 -I want to create a CustomView that would enable the display of these
 objects.
 -The CustomView is defined in its own NIB file.  It consists of a bunch of
 NSTextField objects laid out in NSBox.
 -I then want to use that CustomView all over the place. :)  But for
 starters, I'm trying to create a window with 10 instances of my CustomView.
 -I want to drop the CustomView in other NIB files and set up the
 actions/outlets/etc.

 The path that I took that seemed to give the best promise was:
 I created a CustomViewController (subclassing NSViewController)
 In MyDocument.init, I init the CustomViewController with my CustomView NIB
 file.
 In MyDocument.windowControllerDidLoadNib, I call viewController.view
 setFrame: and then windowController.window.contentView addSubView.

 That manages to get my CustomView to show up in the document's window.  But
 that was done programatically and not in IB.

 Then I looked at the DragAround sample code on the Apple site.  This seemed
 to be exactly give tips for exactly what I wanted, except that the
 DragAroundView draws itself, there is no NIB file for the view.

 If someone can point me to some sample code, that would be great.  In the
 meantime, I'll keep trying.

 Jean Duteau

 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: alternative to NSMatrix due to cell size restriction

2010-02-17 Thread Steven Degutis
You may want to use an NSTableView instead, sort of along the lines of what
iTunes uses in its many different kinds of table-based modes. (Especially
that new one with the artwork.)

-Steven

On Wed, Feb 17, 2010 at 6:17 AM, Eric Boo eric...@gmail.com wrote:

 Hi All,

 I have an NSView in which I'm placing an NSMatrix, with the number of
 columns modifiable by the user.

 The problem is that I need to have cells of differences sizes in the
 NSMatrix so perhaps NSMatrix is not suitable for me.

 The user will be able to drag stuff (text, images etc) into each cell,
 resulting in differing cell dimensions.

 So if NSMatrix isn't suitable because every cell is of the same size,
 what else can I use?

 Thanks!

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Dynamically populate a popup menu

2010-02-17 Thread Steven Degutis
Check out NSPopUpButton's NSPopUpButtonWillPopUpNotification

On Wed, Feb 17, 2010 at 2:49 AM, Peter N Lewis pe...@stairways.com.auwrote:

 Is there any way to dynamically populate a popup menu on the fly (as it is
 exposed)?

 For example, a popup menu that displayed the harddisk hierarchy would need
 this sort of thing - you wouldn't want the entire thing populated as soon as
 you click the popup menu, it would take forever and the user would never see
 most of it.

 Can it be done by subclassing NSMenuItem etc?

 The only alternative I can see would be some sort of custom control based
 on NSBrowser, but that would be a lot uglier for this sort of selection.

 Thanks,
   Peter.

 --
 Keyboard Maestro 4.0.2 now released!  Brand new interface!

 Keyboard Maestro http://www.keyboardmaestro.com/ Macros for your Mac
 http://www.stairways.com/   http://download.stairways.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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Dynamically populate a popup menu

2010-02-17 Thread Steven Degutis
While NSMenuDelegate isn't wrong per se, I still prefer to use the
NSPopUpButton's notification myself. Touching the button's internal menu
seems like dipping my fingers where they don't belong.

-Steven

On Wed, Feb 17, 2010 at 10:41 AM, Jean-Daniel Dupas
devli...@shadowlab.orgwrote:


 See NSMenuDelegate protocol.
 There is some method to dynamically populate the menu.

 Le 17 févr. 2010 à 16:09, Steven Degutis a écrit :

  Check out NSPopUpButton's NSPopUpButtonWillPopUpNotification
 
  On Wed, Feb 17, 2010 at 2:49 AM, Peter N Lewis pe...@stairways.com.au
 wrote:
 
  Is there any way to dynamically populate a popup menu on the fly (as it
 is
  exposed)?
 
  For example, a popup menu that displayed the harddisk hierarchy would
 need
  this sort of thing - you wouldn't want the entire thing populated as
 soon as
  you click the popup menu, it would take forever and the user would never
 see
  most of it.
 
  Can it be done by subclassing NSMenuItem etc?
 
  The only alternative I can see would be some sort of custom control
 based
  on NSBrowser, but that would be a lot uglier for this sort of selection.
 
  Thanks,
   Peter.
 
  --
 Keyboard Maestro 4.0.2 now released!  Brand new interface!
 
  Keyboard Maestro http://www.keyboardmaestro.com/ Macros for your Mac
  http://www.stairways.com/   http://download.stairways.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/steven.degutis%40gmail.com
 
  This email sent to steven.degu...@gmail.com
 
 
 
 
  --
  Steven Degutis
  http://www.thoughtfultree.com/
  http://www.degutis.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/devlists%40shadowlab.org
 
  This email sent to devli...@shadowlab.org

 -- Jean-Daniel







-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Proper way to initialize application support file

2010-02-17 Thread Steven Degutis
Apple's docs explicitly say that this folder should only contain files that
are *not* necessary for the app to function normally. Files that are
necessary should be inside your app bundle, usually.

-Steven

On Wed, Feb 17, 2010 at 4:21 PM, Paul Johnson p...@askerko.net wrote:

 I am working on a Document-based application that needs to have a
 certain file in ~/Library/Application Support/appname before it can
 do anything. It needs to be created the first time the program is run
 (or if it has been deleted by the user).

 I've created a class XXAppDelegate and declared it as implementing the
 NSApplicationDelegate protocol, and I defined
 -(void)applicationDidFinishedLaunching:(NSNotification*)aNotification.
 In this method I want to perform the file creation. Does this sound
 like I'm on the right track? (Newbie as you can tell.)

 I should add that the file needs to be created by accessing the
 internet and could take even a minute to finish, so I will no doubt
 have to worry about informing the user about the delay when the
 program is run for the first time, but before I charge in this
 direction I would appreciate some affirmation I'm on the right track.
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Validation error after setting the value of a boolean attribute

2010-02-16 Thread Steven Degutis
Boolean attributes in Core Data are not actually of type BOOL but rather
NSNumber. Thus, your NO value is interpreted as nil (since nil == 0 == NO)
and you're setting your attribute to nil. If the attribute is required, then
nil is not a valid value, and you will get a validation error. Next time, if
you look at the header of your file, it tells you what types you should use
as arguments to methods, and what types to expect as return values.

Steven Degutis
Software Engineer
Big Nerd Ranch, Inc.
http://www.bignerdranch.com/

On Tue, Feb 16, 2010 at 5:35 PM, Lynn Barton lynnbar...@mac.com wrote:

 Why does my Core Data app give me a validation error message, when quitting
 the app, if the following code is used? I am importing some legacy data to
 set 5 string attributes of an object, but using this code to set the one
 BOOL attribute. In my model, myBooleanAttribute has a default value of NO,
 and the legacy data does not include this attribute, so I can avoid the
 validation error by omitting the following code, but I would like to know
 why it causes errors.

 [myNewObject setMyBooleanAttribute: NO];
 ___

 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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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: Executing shell script with root privilege

2010-02-15 Thread Steven Degutis
Essentially you need to use the Security.framework API which you were
already using in the beginning. You're already heading in the right
direction. If you continue to read the docs on it, you'll get your sample
code working; they're pretty thorough docs I believe.

-Steven

On Mon, Feb 15, 2010 at 1:48 AM, cocoa learner cocoa.lear...@gmail.comwrote:

 Ok let me put my problem in simple words -

 I have a cocoa app and I want to launch a shell script which has to do some
 task with root privilege. How can I do it???

 Regards,
 Cocoa.learner

 On Mon, Feb 15, 2010 at 1:49 AM, Nick Zitzmann n...@chronosnet.com
 wrote:

 
  On Feb 13, 2010, at 11:05 PM, cocoa learner wrote:
 
   And permission of this script is -
   -rwx-- 1 root  wheel  536 Feb 14 10:51 /Users/test/myScript
  
  
   When I am executing the app launchScript is returning me TRUE but my
   script is not getting executed. I am totally lost, have no clue why
 it's
   happening like this.
  
   Does any body know why this script is not getting executed? Am I doing
  any
   thing wrong?
 
  Yes and yes. You set your script's permissions to 700 root/wheel, which
  means that you don't have permission to run the script. AEWP() executes
  tasks with root privileges, but it doesn't execute them _as_ root. If you
  need to do that, then you must use a wrapper that sets the uid to root.
  Check the archives for more information. It might be easier, though, to
 set
  the permissions to 755 instead, and put in a check for root privileges.
 
  And if that still doesn't work, then you might need to execute the shell
 as
  the task, and point the shell to the script, but I'm pretty sure you just
  have the permissions set incorrectly.
 
  Nick Zitzmann
  http://www.chronosnet.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/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.com




-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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


  1   2   3   >