Re: Disabling Exposé in SystemUIMode

2009-08-07 Thread Benjamin Dobson


On 7 Aug 2009, at 06:46:25, Eric Schlegel wrote:



On Aug 6, 2009, at 5:13 PM, Pierce Freeman wrote:


Hi Eric:

I'll make sure to file a big about that - hopefully it can get  
resolved
before shipment.  But, when using the key, it should stop Exposé,  
shouldn't

it?  I have also tested this and it still doesn't work.  Any ideas?


Hmm, yes, the keystroke to invoke Exposé should still be blocked. I  
can't say offhand why it wouldn't be.


And is there any way to make reproduce the "display capture effect"  
without
using this or SetSystemUIMode.  I am attempting to make a full  
screen app,
and don't want the user to have to disable this in the system  
preferences.


You can actually capture the display with the CGDisplayCapture API -  
Exposé can't be invoked when the display is captured. Otherwise, I  
don't think so.


-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/importedfromspace%40googlemail.com

This email sent to importedfromsp...@googlemail.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: How to change focus ring color?

2009-08-02 Thread Benjamin Dobson

NSBezierPath's -setClip.

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBezierPath_Class/Reference/Reference.html#/ 
/apple_ref/occ/instm/NSBezierPath/setClip


On 2 Aug 2009, at 11:46:27, Squ Aire wrote:



Nonetheless, can you (or someone else in here) tell us what guides  
and documents we should read in order to be able to make our  
entirely custom focus rings that draw outside the frame like the  
default one does? It would be nice to know for future reference. Can  
it be done entirely with Cocoa Graphics or is something lower level  
needed?




You are entirely correct, this has been my experience.

In general it's best to avoid drawing your own focus ring if at all
possible, there's a fair bit of "magic" going on when you call
NSSetFocusRingStyle(NSFocusRingOnly) because it draws outside the
control's frame.

--
Rob Keniger


___

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: Yet another memory management question

2009-07-05 Thread Benjamin Dobson


On 5 Jul 2009, at 05:10:12, mmalc Crawford wrote:

If you manipulate an instance variable anywhere other than in an  
initialiser or a dealloc method, you should use a suitable accessor  
method.


Does this apply to instance variables that are not objects too?
___

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: Movable Document Modal Dialogs

2009-07-03 Thread Benjamin Dobson


On 3 Jul 2009, at 19:23:04, Development wrote:

This is more for the user interface experts, than the cocoa  
programming experts...


What is the suggested user interface when creating modal dialogs for  
documents that have be movable? For our application (think of it as  
a drawing program), the user sometimes NEEDS to be able to view the  
document under the modal dialog.  We can not use sheets, because  
they cover up the document window itself.  We can not do Inspectors,  
since the operations are intensely modal.  We could make the dialog  
box application modal (ie. one at any given time), but our client  
has really requested document modal, since they are often working  
with more then one document at the same time. I know how to write  
and invoke the code to make any given window modal to another, but I  
am more concerned about the user interface of this. Is there any  
suggested way to do this? Something to clue the user to what is  
going on?


Thanks,


How about a collapsible sheet? That is, a normal sheet, but at the top  
there is a disclosure triangle that hides the whole contents of the  
sheet, making it about the size of a toolbar. It might not be what you  
want, but it's an idea.

___

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 customize the context menu appearances.

2009-06-22 Thread Benjamin Dobson


On 22 Jun 2009, at 21:37:52, 慧 松本 wrote:


Thank you for the IB Plugin BWToolkit.
http://brandonwalkin.com/bwtoolkit/
I can implement transparent popup buttons in my HUD windows. But the  
menu, that appears from a transparent popup button, has still the  
same appearance as the normal menu, ie. white background and black  
character color.


I want to customize the popup menu and context menu appearances  
suitable to the HUD window.


Does anybody know how to customize the context menu appearances?

Satoshi


You can't.

The only way to do this is to write your own classes for the menu. Or  
better still, use the default appearance. This will be the most  
consistent with the current Mac way of life.___


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: Card Game (like Spider-Solitaire) in Cocoa -- Conceptual ideas needed

2009-06-14 Thread Benjamin Dobson


On 13 Jun 2009, at 11:20:36, Florian Witteler wrote:


Hi Kyril, Nick, Brian and Erik!

I'd really like to thank you all for your comments. You gave me a  
good starting point to move on!
I'll work through these ressources and get back, if I have further  
questions.

Have a nice weekend.

- Florian

P.S.: I'm not familiar with mailing-lists. Do I simply hit 'reply to  
all' when I want to send an answer to that message or how does the  
mailing list know, that I send an answer to that specific message?  
Perhaps there is a beginner-guide -- I didn't find this information  
is the lists' FAQ.


Just press reply and change the To: field to cocoa- 
d...@lists.apple.com. That's all you need to do.

___

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: Making an NSButton appear selected.

2009-06-05 Thread Benjamin Dobson


On 5 Jun 2009, at 12:41:10, Shraddha Karwan wrote:


I have a series of buttons of type NSButton.
When a particular button is selected, I want to make it appear gray  
as in
this button is selected. When another button is selected, I need to  
change
the color of the previously selected button from Gray to normal. By  
gray I

mean textured.
How do I achieve this?


What?

Um. To be specific, I have absolutely no idea what you're talking  
about. It sounds like you might want to try an NSMatrix, though.

___

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: Touchscreens and control scaling

2009-06-04 Thread Benjamin Dobson


On 4 Jun 2009, at 21:47:47, Ricky Sharp wrote:

For a kiosk, you should definitely consider your own UI.  That's  
what I have done.  You'll also find that if your app will be  
exclusively used in touch environments, some of the Aqua controls  
may not fit well at all (since they were designed primarily for  
point-and-click).  (Same thing goes for iPhone OS UI; totally  
different set of controls and behaviors).


Design point: I wouldn't click an iPhone control and I wouldn't tap an  
Aqua control. It doesn't look right for the purpose, therefore it  
doesn't feel right for the purpose. For a touch interface on the Mac,  
roll your own UI style.

___

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 on adding volume control

2009-06-03 Thread Benjamin Dobson


On 3 Jun 2009, at 19:57:53, I. Savant wrote:


On Wed, Jun 3, 2009 at 2:49 PM, Benjamin Dobson
 wrote:

It may be worth noting that these do exist in the Apple Symbols font,
although relying on that could be very shaky ground.


 Hmm ... I can't seem to find the speaker symbols anywhere in that
font, nor in the character palette (under all characters, for each
symbol subcategory). Can you point me to it?


Switch the view to Glyph. Set the font to Apple Symbols. Look under  
4909-4911.


http://www.quicksnapper.com/sabrelight/image/apple-symbols
___

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 on adding volume control

2009-06-03 Thread Benjamin Dobson


On 3 Jun 2009, at 16:23:20, I. Savant wrote:


As for the overall approach, I don't know of a "mic photo", but in
the Mac OS, icons to either side of a slider are usually a small
speaker with no sound waves to the left and one with several (I think
usually three or so) sound waves to the right. There are no standard
icons (called "templates") for this either.


It may be worth noting that these do exist in the Apple Symbols font,  
although relying on that could be very shaky ground.

___

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: Several Questions

2009-06-01 Thread Benjamin Dobson


On 1 Jun 2009, at 12:58:17, Jelle De Laender wrote:


why should your app stops responding?

Do you want to detect time-outs (network-times, IO-timeouts, ...) or  
will your app be crap and full with bugs?


There will always be unforeseen circumstances. Better safe than sorry,  
right?


Just because an app *may* stop responding doesn't mean it's crap or  
full of bugs. It's good that the developer is aware that he isn't  
perfect and might miss something. All sorts of applications have  
crashed or stopped responding on me. I wouldn't say many of them were  
crap and full of bugs.

___

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 disable application menu bar item

2009-05-21 Thread Benjamin Dobson


On 21 May 2009, at 13:36:34, Ashish Tiwari wrote:


Hi All,

I want to conditionally disable some items of my application menu  
bar for example "Format", "Insert" etc, so that user can not click  
on it and can not see its submenu.

When i do following:
[[[NSApp mainMenu] itemWithTitle:@"Insert"] setEnabled:NO];

Menu item "Insert" in menu bar still appears enabled but all items  
in its submenu get disabled. Basically my purpose is solved as user  
can not select any of sub menu items
but i want "Insert" itself to be disabled so that user can not even  
see its submenu.

Is it possible in Mac (Windows it can be done)?
If yes,  then How can i do so.


Why?

It is explicitly against the Apple Human Interface Guidelines to  
prevent a user from seeing submenus, even if all of the items in the  
menu are disabled. Why go against it?


And I don't believe it can be done for menu bar items. It would look  
terrible, too.

___

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 enable by-default the dock menu "open at login" option

2009-05-12 Thread Benjamin Dobson


On 12 May 2009, at 15:26:10, Parimal Das wrote:


Hello
I want that my app should have the dock menu "open at login" item  
selected

by default.
I have seen it in few apps.
Please tell me what to use for that.

Adv Thanx


Don't.

I'm all for adding "open at login" as a preference inside you're  
application, but please, *please* don't make it the default. In answer  
to your question, a quick Google search for "cocoa open at login"  
leads me to http://www.cocoadev.com/index.pl?StartingMyAppOnStartup


Happy coding! =]
___

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 make NSSplitView not dragable

2009-04-28 Thread Benjamin Dobson


On 28 Apr 2009, at 17:44:38, Ashish Tiwari wrote:


Hi All,

I have a horizontal NSSplitView, I want the splitter bar should  
remain in a fixed postion and user should not be able to change size  
of upper subview or lower subview by dragging it.

Note: Split bar should be visible but not be drag able.

Thanks,
Ashish


@implementation DisabledSplitView

- (void)awakeFromNib
{
[self setDelegate:self];
}

- (NSRect)splitView:(NSSplitView *)theSplitView effectiveRect: 
(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect  
ofDividerAtIndex:(NSInteger)dividerIndex

{
// Effectively disables splitter
return NSZeroRect;
}

- (void)drawDividerInRect:(NSRect)aRect
{
// Do nothing
}


@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


Strange NSShadow behaviour in overlapping NSVie ws—bug?

2009-04-26 Thread Benjamin Dobson

Hello all,

I've subclassed NSButtonCell to provide custom drawing. This includes  
an NSShadow. All drawing is done inside the cell's bounds. As I want  
this to work easily in IB with minimum work, I've based it on the  
"Push" button style. This means the clickable button area is  
considerably smaller than the button's frame. This means putting two  
buttons next to each other overlaps the actual frame.


In this situation, the shadow in one of the two buttons is repeatedly  
drawn on top of itself, getting darker and decreasing in quality. Is  
this a bug or am I doing something wrong?


The code can be downloaded here: http://dl.getdropbox.com/u/896591/TestApp.zip

(Yes, I am making a set of HUD controls. And yes, I know there are a  
variety of third party frameworks available. However, I decided to  
create my own—both as a programming exercise and to avoid images.)___


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: Editable PopUpButtons

2009-04-26 Thread Benjamin Dobson


On 26 Apr 2009, at 04:18:56, Arun wrote:


Hi

Is the any control which is similar to NSPopUpButtonCell but still  
editable?


Thanks
Arun KA


NSComboBox.
___

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: Conversation-style controls?

2009-04-25 Thread Benjamin Dobson


On 24 Apr 2009, at 15:44:51, Christopher Gillis wrote:


How would I go about attaining a conversation-style layout. Tweetie (
http://www.atebits.com/tweetie-mac/ ) is a perfect example of the  
layout I

would like to achieve. I can get something similar by subclassing
NSTableView but it seems to me like it's a convoluted approach to what
should be a simple problem.


You could just subclass NSCell.
___

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 make app login window to look like OS X user login window ?

2009-04-22 Thread Benjamin Dobson


On 22 Apr 2009, at 17:06:10, Chris Williams wrote:

So you'd rather the user sits there wondering if this huge, highly  
complex
application (like any Office or Adobe app) that takes 10-15 seconds  
to load,
even longer on a slow laptop, is actually starting up, or should I  
click it

again, or is my computer dead, or "what the heck is going on here"...?

Splash screens serve a purpose other than advertising.  No program I  
know of
actually delays the load to show the splash screen.  Rather, they  
are a

prettier way of saying "loading...".

I have an application that connects to a SQL server.  The app itself  
isn't a
slow loader, but the connection to the SQL server (often on another  
computer
or on hard drives that may be asleep) can take 5, 10, or more  
seconds to
establish.  The splash screen shows that progress and let's the user  
know

what things are being done.  Far better than a spinning beach ball.


Yes, but the vast majority of applications do not take that long to  
load. It may be a prettier way of saying "Loading...", but unless it's  
got an actual progress bar on it it's just aggravating. I'll also  
throw in here that I have seen splash screens that have a higher  
window level than normal. This is just wrong. If you're app takes long  
enough to load to warrant a splash screen, it takes long enough to  
load for the user to get impatient and try to do something else.

___

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 make app login window to look like OS X user login window ?

2009-04-21 Thread Benjamin Dobson


On 22 Apr 2009, at 06:32:55, Mario Kušnjer wrote:


Greetings everyone !

So the question is how to make a window that doesn't have a title  
bar and borders ?

Actually I would like it to be just like user login window of OS X.

This could also go for a so called "Splash Screen" on app launch.


Although I'd appreciate it if you could in any way avoid the latter. I  
have always found them extremely annoying on OS X. If you're app takes  
a long time to load, something small and simple like what iWork does  
seems better.___


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: Exit an Application

2009-04-14 Thread Benjamin Dobson


On 13 Apr 2009, at 22:52:15, Uli Kusterer wrote:

or the slightly shorter and a thoretically a tad more dangerous  
similar call with NSApp in it are really the only option. (Well,  
theoretically you could send yourself a "quit" Apple Event, but  
that's only of academical interest...)


Why is it more dangerous to use NSApp?
___

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: Floating window on top of everything

2009-04-09 Thread Benjamin Dobson


On 9 Apr 2009, at 20:02:34, Matt Neuburg wrote:

Oh, I thought "floats above another application" meant "floats above  
another
*particular* application". After all, if that isn't what's meant,  
then why

didn't he start by asking for a HUD window that just floats above all
applications always?

You see, I've written some applications where I've got a floating  
window
that floats above *my* app if it is frontmost, but also floats a  
certain
particular other app if *it* is frontmost. (But vanishes if any  
*other*

application is frontmost.) Thus, my application's window and my
application's abilities are, as it were, injected into this one other
application, supplementing it. Now, of course the OP's original note  
was
confusingly written, but still, I thought I recognized in it a  
desire to do

the kind of thing I was doing... m.


I think we really need clarification from the OP here. :-)
___

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: Floating window on top of everything

2009-04-09 Thread Benjamin Dobson


On 9 Apr 2009, at 16:49:48, Matt Neuburg wrote:

On or about 4/8/09 11:25 PM, thus spake "Andrew Farmer" >:



On 08 Apr 09, at 08:03, Matt Neuburg wrote:

On Tue, 7 Apr 2009 12:37:05 -0400, Walker Argendeli
 said:
I am making a simple application that consists of a small HUD  
window

that needs to float above another application.  How do I make it so
that A. it floats above everything, and B. when I switch to another
application, it remains on top.


Search the archives for example code showing how your app can be
notified
when an app switch occurs... m.


This isn't necessary, actually. Setting the window's level to
NSFloatingWindowLevel or so, and setting it to not hide on  
deactivate,

should be sufficient to make it stay above everything.


Really? He wants the HUD window to float above a certain *particular*
application — different from his own — and vanish when any other  
application
is frontmost. What, in your proposed architecture, would make it do  
that? m.



That's not what he said:

How do I make it so that A. it floats above everything, and B. when  
I switch to another application, it remains on top.

___

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


Transparent NSButtonCell highlight

2009-04-08 Thread Benjamin Dobson

Hi,

I'm building a transparent interface, and I'm stuck at NSButtonCell.  
An NSGradient with transparency is drawn in the cell. It overrides - 
isOpaque to return NO. The gradient is drawn nicely from  
drawWithFrame:, but if it's called from -highlight:withFrame:inView:,  
the gradient is drawn on top of everything that's already been drawn,  
resulting in an increasingly dark result when the button is pressed.


I feel I'm missing something fundamental here. I also hope that makes  
sense to everyone.


–––

- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView: 
(NSView *)controlView

{
if (flag) {
		[self realDrawWithFrame:cellFrame inView:controlView  
gradient:pressedGradient];

} else {
		[self realDrawWithFrame:cellFrame inView:controlView  
gradient:buttonGradient];

}
}

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
if (![self path]) {
NSRect roundRect = NSInsetRect(cellFrame, 6, 6);
roundRect.origin.y = roundRect.origin.y - 1;
[self setPath:[NSBezierPath bezierPathWithRoundedRect:roundRect

  xRadius:roundRect.size.height / 2

  yRadius:roundRect.size.height / 2]];
}

if ([self isHighlighted]) { // Handle keyboard equivalent
[self highlight:YES withFrame:cellFrame inView:controlView];
return;
}
	[self realDrawWithFrame:cellFrame inView:controlView  
gradient:buttonGradient];

}

___

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: finder file size

2009-04-08 Thread Benjamin Dobson


On 8 Apr 2009, at 19:40:35, Sean McBride wrote:


On 4/7/09 9:04 PM, Jo Phils said:

As for not using Carbon I suppose there's no reason I can't use  
it.  I
was just thinking with Finder going away from Carbon and since I'm  
just

learning Cocoa I was trying to avoid it if I could.  But if it's the
best way I can use it...


Carbon is an overloaded term, it means many things all at once.
Finder's Carbon->Cocoa transition refers, I think, mostly to its UI
implementation.


And would be the only reason people should be interested. Carbon is  
still extremely useful, but I understand that the UI section has been  
superseded by AppKit. There's nothing wrong with the non-UI part of  
Carbon, but I don't imagine the UI will be getting all the updates  
that AppKit will get, making most of it outdated. It's already  
started: the Carbon UI is not 64-bit, but the rest of Carbon is. It's  
important to understand that Carbon isn't a bad thing to use in a  
Cocoa app if it makes things easier.


I say you should dip in to Carbon if it helps, but if there's a Cocoa  
way to do the same thing, that's probably preferred.

___

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: circular NSSlider not endless

2009-04-08 Thread Benjamin Dobson


On 8 Apr 2009, at 13:48:43, Tilo Villwock wrote:

Does anyone know, whether there is a way to make a circular NSSlider  
not endless, so that it stops at a certain value?


Thanks

Tilo


That depends what you mean. If you mean it should act like a physical  
volume control, where the slider only turns through about 270°, then I  
suggest you simply subclass it and test if the value is, say, more  
than 80, then set the value to 80.


More details would help us respond to your 
question.___

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: iPhone Tab bar Question

2009-03-24 Thread Benjamin Dobson


On 24 Mar 2009, at 01:02:27, Jason Todd Slack-Moehrle wrote:


Hi All,

I created a standard iPhone application using the built-in wizard  
and it builds and runs fine.


My question is how do I modify the tab bar at the bottom to not make  
space for an image. I dont want to use images and I dont see how to  
adjust the height of the bar so I gain some extra space.


Be careful there. Enough space for text only would be very hard to hit  
with your finger. And consider carefully about what you want to do –  
images provide very useful UI cues and make it *look* more like a tab  
bar.___


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: Simulating (or obtaining) menubar effect in a Cell

2009-03-24 Thread Benjamin Dobson


On 24 Mar 2009, at 01:46:13, Tobias Zimmerman wrote:


Hello all-

I am working with an NSMatrix, and I would like one cell of the  
Matrix to
act just like an item in the menu bar.  Specifically: Single  
clicking should
open a menu; holding the mouse down should open the menu and then  
close it
when released; when selected the item should highlight/invert just  
like an

item in the menubar.

I have played with NSButtonCell, NSPopUpButtonCell, and other  
subclasses of

NSCell, but I can’t seem to hit on the right combination of options to
replicate the behavior of a menubar item.  Can anyone suggest the
appropriate combination of elements that would achieve this effect?   
If it
isn’t possible to do “out of the box”, then suggestions for  
subclassing

NSCell would be welcome.


In what way does NSPopUpButtonCell act incorrectly? It seems to work  
for me, but obviously, I don't know exactly what your target is.___


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: De-Mystifying NSCell

2009-03-24 Thread Benjamin Dobson
Thanks for this, I've been doing a lot of NSCell work recently. I'll  
definitely be watching it when I get home!

___

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: Custom windows -- just curious

2009-03-23 Thread Benjamin Dobson


On 23 Mar 2009, at 17:13:22, Тимофей Даньшин wrote:


Hi.
Does anybody know how to make totally custom windows, such as the  
control window in DVD Player or the minimized iTunes window?

As i said in the subject -- I am just curious.

Timofey.


Override -initWithContentRect:styleMask:backing:defer: to change the  
styleMask to NSBorderlessWindowMask.___


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 say app using only my plug-in?

2009-03-22 Thread Benjamin Dobson


On 22 Mar 2009, at 18:34:46, Carlo Gulliani wrote:

I finished project, which use Flash player plug-in. But if user has  
same plug-in (but old version), my application load his. I wanna  
that app use just my plug-ins from my folder (myapp.app/Contents/ 
PlugIns/Flash Player.plugin) and doesn't use system's plug-in. how  
to do so?


I think you just install it in the user domain. Nothing wrong with  
helping users avoid up-to-date software. But please, warn them you're  
doing this.

___

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: Customization of NSSavePanel

2009-03-20 Thread Benjamin Dobson


On 20 Mar 2009, at 13:39:42, Sourabh Sahu wrote:


Hi Everyone,
I am trying to customize NSSavePanel using method  
prepareSavePanel,but I want NSSavePanel browsing feature to be  
disabled that is user cannot change the directory ,apart from it I  
also want NSSavePanel to show file of any particular type,suppose I  
want to show only text files.all other files should get hide.

Thanks in advance,
-Sourabh


NSSavePanel does not and should not hide files. The file system in  
NSSavePanel/NSOpenPanel looks the same as in the Finder – that's how  
it's meant to be. It also allows users to place files where they like.  
That's pretty much the point.


Given that you don't seem to want *any* of the features of  
NSSavePanel, why not just bring up a dialog box with a text field for  
the filename and a "Save" and "Cancel" button? That's all you seem to  
want of the built-in functions, so just do that.___


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 there an icon to represent "select all"?

2009-03-20 Thread Benjamin Dobson


On 20 Mar 2009, at 18:31:42, David wrote:


Is there a standard icon to represent "select all"?


I believe not. There generally isn't any icon for it at all.


Is there a better website where I should ask this?


Not that I know of. :-)
___

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: Custom NSManagedObject Class Initializer

2009-03-15 Thread Benjamin Dobson


On 15 Mar 2009, at 04:03:19, Kyle Sluder wrote:

 if(self = [super initWithEntity:desc  
insertIntoManagedObjectContext:ctx])

 {


This line will generate warnings, which is not helpful in this case.  
This will not, and is the default for built-in subclasses. As such, I  
prefer it:


self = [super initWithEntity:desc insertIntoManagedObjectContext:ctx];
if (self)
{
// do stuff
}
return self;
___

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: Background Process?

2009-03-10 Thread Benjamin Dobson


On 10 Mar 2009, at 23:11:03, Pierce Freeman wrote:


Hi everyone:

I am wondering how to create a background process that will only run  
when
the user is logged in and will run every certain minutes (a bit like  
Time
Machine).  I am also not sure in which way the action in the  
background
process would be programmed, so any information regarding this would  
be

great.


Thanks for any help.


launchd. Take a look at Lingon  for a quick  
practical look at what it does. And Google. Always Google.

___

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: Making a border-less window is not working

2009-03-08 Thread Benjamin Dobson


On 8 Mar 2009, at 15:40:18, Gustavo Pizano wrote:


Hello,

I have created a custom NSWindow class, there I implemented the method
- (id)initWithContentRect:(NSRect)contentRect styleMask: 
(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType  
defer:(BOOL)deferCreation screen:(NSScreen *)screen

{

I set up the alpha value and the other parameters following the  
example "RoundTransparectWindow" which is in the developer  
connection. Now, in IB, I changed the window to be not a NSWindow  
but my custom window class.


I tried the app, but the window it's still with borders and it's not  
transparent.  I set up a a NSLog(@"intitalizing window") as the  
first code line in the initWithContentRect method, but the console  
shows nothing, so the method its never been called. I dunno what  
could I have missed in the process but I hand;t been able to get it  
work.


Any clues?


Get rid of the screen parameter. That'll fix 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: Setting 'is package' bit when building a plug-in bundle?

2009-03-07 Thread Benjamin Dobson


On 7 Mar 2009, at 03:31:44, Graham Cox wrote:

I'm implementing a plug-in scheme based on Rainer Brockerhoff's  
design at http://cocoadevcentral.com/articles/68.php


So far it's working fine, but I decided I wanted to use a particular  
extension for my plug-in files. When I do that, the bundles revert  
to looking like ordinary folders in the Finder, and can be simply  
opened like any folder.


How can I set the 'package' setting when I build my bundle project  
so that it's treated as a single package? I can't see a build  
setting for doing this in the project, and simply adding  
'LSTypeIsPackage' to my bundle's info.plist has no effect.


--Graham


Set "Force Package Info Generation" under the build settings to true.

___

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: Saving a plist file from a thumbdrive

2009-03-04 Thread Benjamin Dobson


On 4 Mar 2009, at 20:17:21, Francois Cournoyer wrote:


Hi,

We have an installer app that runs from the root folder of a  
thumbdrive like device,
The installer is ran from a subfolder or from subfolder on a hard  
disk works correctly.
The problem is when it runs from the root of the thumbdrive,  
everything seems to be installing fine, but there’s 1 area which  
seems to fail.
We create a plist file for preferences in users/shared/Application  
Support/myApp/myApp.plist


for some reason, the creation of this file fails, but works if it’s  
launched for a subfolder on the same drive.


Is there anyway to fix this? (the installer is already running with  
Admin rights)


Probably, but is there any reason you can't create the plist on first  
launch instead of install?___


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: where to store this kind of data

2009-03-03 Thread Benjamin Dobson


On 3 Mar 2009, at 22:13:08, Stefan Groschupf wrote:


Hi All,
I'm very new to cocoa - though have other oo language experience.
My goal is write an application that synchronize some servers with a  
local os x app.
When my app starts it basically should list all available server  
connections if this is empty open a form window where the user can  
add a connection to a remote server I will sync from.
Basically the app will have many serverConnection entities that  
might get more or less complex relationships later.


So I looked at core data - that is pretty cool, though I dont want  
the user to save or load this kind of configuration. I can do this  
in the background? Where to store this file?
On the other hand since I might have many server connection and an  
relations I wonder if user defaults wold be a better place. Or of  
corse I can just use archiving, but where to sore this data than?


What would be a best practice here?


Store it in ~/Library/Application Support/YourAppName/
___

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


NSCell highlighting for keyboard equivalents

2009-03-03 Thread Benjamin Dobson

Hello,

I have a subclass of NSButtonCell. It overrides -drawWithFrame:inView:  
and -highlight:withFrame:inView: to produce a customised look.  
However, highlight:withFrame:inView: is not getting called from the  
keyboard equivalent. I'm sure I'll look pretty stupid for asking this,  
but I couldn't find it in the docs. Why doesn't the keyboard  
equivalent highlight my button? 
___


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 create a simple pop-up-menu

2009-03-02 Thread Benjamin Dobson


On 2 Mar 2009, at 16:42:00, Ulai Beekam wrote:



Hi,

How do I create a Safari-style pop-up menu? I'm talking about the  
pop-up menu (be sure to correct me if this thing is not even called  
a pop-up menu) that appears when you click the ">>" button to show  
off-screen tabs.


Just open Safari (use version 3) and keep creating new tabs until  
the ">>" button appears to the right. And then click that button.  
You will see the menu I want to achieve.


How can I programmatically make such a menu appear on my custom  
NSView in my mouseDown: method? Do you have some simple sample code  
please?


Use NSPopUpButton.

___

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


Changing the inactive selection highlight colour

2009-03-01 Thread Benjamin Dobson

Hi,

In my app, I have HUD-style windows and controls. The field editor for  
the window has been customised to show a more appropriate selection  
colour. However, when the window is inactive, the selection is  
highlighted in the standard light grey. How can I change this colour  
to something more readable?

___

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: Moving oneself to /Applications (or ~/Applications)

2009-02-22 Thread Benjamin Dobson


On 23 Feb 2009, at 05:47:22, Adam Leonard wrote:

(If you want another opinion, I don't think what you are doing is a  
bad idea. John Gruber made a point in a recent article (http://daringfireball.net/2009/02/untitled_document_syndrome 
) that most users don't want to mess with the file system at all  
anymore. For example, you don't have to worry about where iPhoto is  
putting your photos, and the iPhone has no GUI file system access at  
all. Also as Gruber notes, the vast majority of people who don't  
like these features and want complete control of the file system are  
programmers, i.e., the people on this list.)


This is partly why I like the idea Andreas suggested. Messing with the  
filesystem is something users - including myself - rarely like doing.  
The original example in that article was of the save dialog – a chore,  
something people would avoid using.* Installer packages are less of a  
chore, as you do not have to make arbitrary decisions. But they are  
still annoying, as apart from anything else I want to be able to use  
an application from the moment I've downloaded it. Andreas' idea gets  
rid of almost all the work on the user's part while keeping the  
filesystem tidy.


On a side note, Gruber's article shouldn't be taken to mean that all  
apps should save work to an in-built "library". This would probably be  
confusing in the case of word processors, for example.


*Many times when I am working on a document I press Command-S out of  
habit, then seeing the Save dialog appear quickly press Escape.___


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: Application Activation

2009-02-22 Thread Benjamin Dobson


On 22 Feb 2009, at 10:56:45, Gerriet M. Denkmann wrote:


There are two ways an app can become active:
1. by explicit user action (clicking in Finder, clicking in Dock,  
using Command-Tab)

or:
2. without user action (frontmost app is closed or hidden, so the  
next app becomes active).


Command-Tab should be under the second category: document-based  
applications do not open a new document with command-tab. Your app may  
not be document-based, but it should behave in a similar way.

___

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: Can anyone suggest a way to do this?

2009-02-14 Thread Benjamin Dobson


On 14 Feb 2009, at 03:52:11, Graham Cox wrote:

This may be more appropriate for the Quartz mailing list, which I'm  
not on, so I'll ask here first...


When stroking a path, I can clip to the inside or the outside of the  
path to get a stroke inside or outside of the path's edge. But if  
the path is open-ended, this doesn't work. Instead what I need is  
clipping to the "left" or "right" of a path, not to the "inside" or  
"outside".


My question is, can anyone think of any way in which this might be  
accomplished?



--Graham


Depending on the effect you want, NSShadow might do the trick here.
___

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: Transparent Image

2009-02-12 Thread Benjamin Dobson


On 12 Feb 2009, at 04:37:35, Michael Ash wrote:


On Wed, Feb 11, 2009 at 3:41 PM, Christian Graus
 wrote:

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

found some MAJOR bugs in WPF ).  I assume if I go to the Apple Dev
Connection and log in, I'll be able to find a place to log bugs ?


Hah, Apple do something about filed bugs, right. Looking at the list
of bugs I've filed, the most common state is "Open". The next most
common state is "Duplicate". And don't think that "Duplicate" means
your bug gets merged into the original and now you get told about
what's happening with the original bug. No, "Duplicate" is a black
hole of information. Once your bug is marked "Duplicate", you lose,
game over, no more information will be arriving, ever.

Filing bugs can be worthwhile. Perhaps 5% of the time it actually gets
results. But be prepared for very little reward.

Mike


Apple have asked for more information on about half of my bugs, but  
most of them do remain unfixed.


___

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: [Q] Control over the "You cannot use the application ... with this version of Mac OS X" string

2009-02-04 Thread Benjamin Dobson


On 4 Feb 2009, at 22:01:06, Eric Gorr wrote:



On Feb 4, 2009, at 1:44 PM, Sean McBride wrote:


On 2/4/09 10:24 AM, Joar Wingfors said:


When launching an application which requires a newer version of the
OS, the OS displays the string:

 "You cannot use the application "XXX" with this version of Mac OS
X."

I was just wondering if there was any way to control what appeared
here so it wasn't so curt - it would be nice to mention what the
minimum version of the OS was, for example.

I'm guessing there isn't...



And yes, there is no control over the message.



I'm actually curious about something.

Do people just accept this behavior or does anyone bypass the check  
that Apple does and do their own checking, supplying their own  
message?


This seems popular, but I personally just accept the behaviour.

http://weblog.bignerdranch.com/?p=13

___

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: Stroking a CATextLayer

2009-02-04 Thread Benjamin Dobson

Thank you. I now have it working nicely.

On 3 Feb 2009, at 18:09:37, David Duncan wrote:


On Feb 3, 2009, at 7:43 AM, Benjamin Dobson wrote:


On 3 Feb 2009, at 15:05:51, glenn andreas wrote:


On Feb 3, 2009, at 8:50 AM, Benjamin Dobson wrote:

Has anyone managed this, short of creating a separate layer for  
the stroke? The Google machine doesn't seem to provide any answers.


Since CATextLayer uses an attributed string, why can't you just  
set the attributes to have the text stroked (set the  
NSStrokeColorAttributeName appropriately, and then use a negative  
value for the NSStrokeWidthAttributeName to indicate that the text  
should be both stroked and filled).


That is what I would expect; however, the layer does not stroke the  
text.


The CATextLayer uses Core Text to do its drawing, so it supports  
what Core Text supports (and I'm not familiar with what the  
limitations are here). It will likely be simpler to draw the text  
yourself into a plain CALayer rather than try to make the  
CATextLayer do what you want to do.

--
David Duncan
Apple DTS Animation and Printing

___

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: processName and Bundle Name -- the same?

2009-02-03 Thread Benjamin Dobson


On 3 Feb 2009, at 21:12:14, Stuart Malin wrote:

In order to locate certain application-specific directories, I use  
the application's name (say, for example / 
Library/


Presently I am using
[NSBundle mainBundle]  objectForInfoDictionaryKey:@"CFBundleName"]
to get the application name.
(in my info.plist, the Bundle Name is set from $(PRODUCT_NAME).

I suspect that I could alternatively use
[[NSProcessInfo processInfo]  processname]
to get the processName.

Is one of these approaches better than another?
Is there a difference?
Perhaps the process name is derived from the bundle name?


The executable name and bundle name can be set separately, and I  
believe the process name is the same as the executable name.


So I would say to go for the first one.
___

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: Stroking a CATextLayer

2009-02-03 Thread Benjamin Dobson


On 3 Feb 2009, at 15:05:51, glenn andreas wrote:



On Feb 3, 2009, at 8:50 AM, Benjamin Dobson wrote:

Has anyone managed this, short of creating a separate layer for the  
stroke? The Google machine doesn't seem to provide any answers.


Since CATextLayer uses an attributed string, why can't you just set  
the attributes to have the text stroked (set the  
NSStrokeColorAttributeName appropriately, and then use a negative  
value for the NSStrokeWidthAttributeName to indicate that the text  
should be both stroked and filled).


That is what I would expect; however, the layer does not stroke the  
text.

___

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


Stroking a CATextLayer

2009-02-03 Thread Benjamin Dobson
Has anyone managed this, short of creating a separate layer for the  
stroke? The Google machine doesn't seem to provide any answers.

___

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: Drawing Invalidation Question

2009-02-01 Thread Benjamin Dobson


On 1 Feb 2009, at 05:41:49, Seth Willits wrote:


When inside of -[NSView drawRect:], what's the difference between

- (void)drawRect:(NSRect)rect;
{
 if ([self needsToDrawRect:someRect])
 
}


... and ...


- (void)drawRect:(NSRect)rect;
{
 if (NSIntersectsRect(rect, someRect))
 
}


... ?


Apart from anything else, the first makes it clear what your intent  
is, which would be useful when you return to that bit of code later.

___

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 draw text with fade out effect?

2009-02-01 Thread Benjamin Dobson


On 29 Jan 2009, at 06:32:45, Kyle Sluder wrote:


Perhaps the better solution is to draw the text as normal and then
re-draw the background with the appropriate alpha on top.


Am I missing something or could you use an NSGradient object to do this?
___

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


Hillegass: Animation, NSProgressIndicator and Bindings

2009-01-27 Thread Benjamin Dobson

Hi,

I'm in chapter 24 of Hillegass's book, which contains an  
NSProgressIndicator bound to AppController.count (AppController being  
an NSObject subclass). One thing is really bugging me: when  
AppController.count is updates, the progress bar immediately jumps to  
the new position, instead of animating like you would expect. I have  
looked at the documentation for NSProgressIndicator and found nothing  
that appears to animate a determinate progress indicator. What is the  
normal method to do this?


(Note that the stripes moving to the left are animating fine.)
___

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: NSCaledarDate's deprecation

2009-01-22 Thread Benjamin Dobson


On 22 Jan 2009, at 22:52:56, kvic...@pobox.com wrote:

in anticipation of the deprecation of NSCaledarDate, i am in the  
process of converting my app to use NSDate and friends. and while  
the process is mostly straightforward and not all that difficult, it  
is tedious.


when i think i'm done, i'd like to be able to do a fresh build and  
if possible have the compiler tell me any places i might have  
missed... these would be places where i used a method of  
NSCalendarDate that i missed with all my text searches.


is there anyway to get the compiler to do this for me?


If you delete all occurrences of NSCalendarDate and what relevant code  
you can see, the compiler will pick up on undefined variables.

___

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: Interaction with web javascript & cocoa

2009-01-20 Thread Benjamin Dobson


On 20 Jan 2009, at 22:06:52, Alex Mills wrote:


Hey,

I have built a Javascript WYSIWYG editor. I want to build a WebKit  
based cocoa app with buttons that can call a function from the  
editor loaded in webkit. For example I want to have a button within  
the Cocoa interface that calls the Javascript function 'makeBold()'  
to make the selected text within the editor bold. If this is  
possible I then want to save the editor generated html to string so  
that I can store it within Core Data. I checked out the Apple Webkit  
programming guide but it doesn't provide much.


Any help would be greatly appreciated.

Cheers
Alex Mills
www.alexmillsdesign.com


I would assume you just send the web view to a javascript: URL, but I  
haven't even looked at the docs on this one.


___

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: Poll Processes For Menu Bar Items?

2009-01-15 Thread Benjamin Dobson


On 15 Jan 2009, at 18:44:22, Chunk 1978 wrote:


i'm trying to poll the active processes for menu bar items (Volume,
Date & Time, etc.) but the NSDictionary key
@"NSApplicationBundleIdentifier" doesn't seem to recognize the bundle
identifier for them.


Each one of them is a plugin for SystemUIServer, not an application.

___

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: Highlighting an NSPopUpButtonCell subclass

2009-01-12 Thread Benjamin Dobson


On 11 Jan 2009, at 11:45:49, Benjamin Dobson wrote:

I have an NSPopUpButtonCell subclass for custom drawing. Quite  
simply, how can do custom highlighting before the popup menu  
appears? - highlight:withFrame:inView: is called before the menu  
appears, but no drawing is done. The same code in an NSButtonCell  
subclass works fine.


To follow up, someone on MacRumors pointed me to checking [self  
isHighlighted] in drawRect:inView:
From there I am calling highlight:withFrame:inView: directly, and all  
is going well.

___

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: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 20:56:56, Donnie Lee wrote:


Now that explains it. Take a look at NSSegmentedControl.


Looks nice, but how to align an image in segment, how to implement
imageDimsWhenDisabled and how to choose button style (I need a pop-up
button there, I found how to add a menu to segment but triangle is not
appears)?


Hmm, you have a point about aligning images. One option would be to  
simply have the image displayed on its own, and the segmented control  
simply being the rightmost segment. It's not pretty, and I actually  
think Dave's suggestion looks nicer in this case.

___

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: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 19:39:29, Donnie Lee wrote:


I see there is unavoidable problem with my "fake" button and
Accessibility tools which may happens. I planned to use it to emulate
gradient bottom bar (under Source List control), looks like in
Mail.app. I created three buttons, two gradient action-buttons and one
gradient non-clickable button with image aligned to right. This image
is a "three lines" which act as
additionalEffectiveRectOfDividerAtIndex: of NSSplitView. It looks
really nice but the fact that is a button...can it hurt people with
Accessibility devices?

Really, I don't like all these additional libraries that try to
emulate gradient bottom bar, because they redraw these controls by
itself, and I would like to use only Apple controls.


Now that explains it. Take a look at NSSegmentedControl.
___

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: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 18:57:54, Donnie Lee wrote:


The main problem that people think that I try something stupid.
Instead of technical discussion they try to teach me what should I do
and how should I do it. Like a religious zombies, seriously.

Donnie.


If someone was trying to build a car with superglue, would you blame  
people for thinking they were doing something stupid, even if they had  
a good reason?


In technical areas, misunderstandings are not uncommon. So people  
pressing you until they get an answer is the right thing to do because  
you might be doing something really, really stupid without realising.

___

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: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 18:54:19, Donnie Lee wrote:


You read too much Tolkien. It's hard to me to trace which messages
sent to list and which is not because crazy lists.apple.com software
didn't provide "reply-to" field and I enter "to" address manually.

PS: Now only "reply to all" button.


Ever heard of Rules?

Any recipient contains: cocoa-dev@lists.apple.com

Move message to mailbox: Cocoa Dev

Simple, eh?

___

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: Mac Pro memory sizes

2009-01-11 Thread Benjamin Dobson


On 11 Jan 2009, at 22:04:09, Kenneth Bruno II wrote:

In actuality a gibibyte (GiB) is 2^20 bytes but it's not used in all  
the places it should be used.


It's rarely used at all, for several reasons. One is that it makes  
little sense to your average consumer, but the more amusing reason  
that standard isn't used is because "kibibyte" sounds like a  
children's breakfast cereal.


In general, it depends on the level of technical discussion going on.  
In this area it should always mean 2^30, in my opinion. In context of  
discussing hard drive sizes with your neighbour, it rarely matters.  
Remember: context. For example, a discussion on Wikipedia is leaning  
to wards constant use of giga- anyway to prevent confusion. In  
general, the discussions which occur on these lists would not generate  
such confusion when gibi- is used, but use of giga- to mean 10^9 would  
be far less useful than the "real" value of 2^30.

___

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


Highlighting an NSPopUpButtonCell subclass

2009-01-11 Thread Benjamin Dobson
I have an NSPopUpButtonCell subclass for custom drawing. Quite simply,  
how can do custom highlighting before the popup menu appears? -  
highlight:withFrame:inView: is called before the menu appears, but no  
drawing is done. The same code in an NSButtonCell subclass works fine.


___

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: Which language to get started with cocoa development?

2009-01-06 Thread Benjamin Dobson


On 1 Jan 2009, at 17:23:50, Achim Domma wrote:

Thanks to everybody giving feedback to my question! Obviously I'll  
have to get started with ObjC. Most people refer to the Cocoa design  
patterns I'll have to get used to. Currently I think about buying http://www.pragprog.com/titles/dscpq/cocoa-programming 
 to speed up my first steps. What other book or online resource is  
recommended to learn Cocoa design patterns? You can assume that I  
have some experiences reading documentation and that I'm familiar  
with design patterns in general.


thanks again,
Achim


Aaron Hillegass's Cocoa Programming for Mac OS X is an excellent book.  
You'll probably find much of it a bit below your level to start with,  
but a lot of it will probably be new stuff that will really help you.  
Speaking from my own experience here.

___

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


NSBorderlessWindowMask and Leopard's Spaces

2009-01-06 Thread Benjamin Dobson
In my application, I am using a custom window based on  
NSBorderlessWindowMask. You can drag the titlebar to move it around.  
How do I make this play nice with Spaces?


Dragging to the edge of the screen should switch space after a short  
delay, and holding the titlebar while switching space should bring the  
window with it.


I really don't know where to start on this. The release notes don't  
seem to cover this.

___

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: NSSplitView

2008-12-31 Thread Benjamin Dobson


On 31 Dec 2008, at 22:53:46, David Blanton wrote:

In Xcode 2.4.1 , debug view, all in one, the stack and vars are  
split, and below is source and there is one control point that moves  
the vert and horiz splitters


Some Apple magic perhaps?


I think posting a screenshot on the web would help those of us who do  
not have access to Xcode 2.4.1 right now.

___

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: AW: NSColorWell shows no color

2008-12-30 Thread Benjamin Dobson


On 30 Dec 2008, at 19:22:04, tobias assmann wrote:


//  InActiveBeatColor has been selected
- (IBAction)iaSelectInactiveBeatColor:(id)sender{
   [topv.colors setColor:[sender color] forKey:@"inactiveBeat"];
}


You can probably do this using Bindings. 
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html
___

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: Scrollwheel ignores line scroll setting in NSScrollView - bug?

2008-12-30 Thread Benjamin Dobson
In addition to what Michael said, I say that the amount scroll wheels  
scroll is the same across all apps. Changing this value would make the  
application feel disproportionate and odd.

___

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: [NSImageView animator] - will this animate setImage: ?

2008-12-30 Thread Benjamin Dobson


On 30 Dec 2008, at 12:52:45, Benjámin Salánki wrote:


Hi all,

I was playing around with core animation and was wondering if  
sending animator to a view, specifically an NSImageView, will it  
only manage animation of bounds and size and rotation changes or can  
it too be used for changing the contents of the NSImageView? I am  
trying to animate the change in the NSImageView, but hence with no  
luck.


Hope I'm not mistaking core animation for what it is not :D


Core animation could do this, but it is not possible through animation  
proxies. I believe NSAnimation will be the easiest path to go down.___


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: toolbar to view gradient displaying correctly only sometimes?

2008-12-20 Thread Benjamin Dobson
It certainly doesn't blend the toolbar to the toolbar to the window,  
but I don't see anything else wrong with the gradient.


Why do you want to do this anyway? Note that the gradient will always  
look silly on Tiger.


On 20 Dec 2008, at 17:39:16, Chunk 1978 wrote:


i have a window with a toolbar, and instead of having a sharp
separation between the toolbar and window, i've created a gradient
from toolbar color to window color (which is simply a custom view
placed over the window).  this gradient looks correct on my iMac 24",
and correct on other MacBooks.  however, i'm now on my dad's 20" iMac
and the gradient isn't smooth at all.  it is clearly a gradient band
that is separating the toolbar from the window's view area, instead of
a proper gradient.

i'm assuming this is a problem with the screen/color on my dad's 20"
iMac (Alu 2007), but i can't be sure.

it would be great for others to look at this attached image and post
back whether the gradient is proper, or if it is clearly a band
because the gradient's colors are darker than they should be.  also,
eventhough this isn't a cocoa dev question, is there a reason why my
dad's 20 alu iMac 2007 would be displaying this gradient improperly?
___

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/importedfromspace%40googlemail.com

This email sent to importedfromsp...@googlemail.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: Where is the Computer Image ?

2008-12-16 Thread Benjamin Dobson


On 16 Dec 2008, at 16:45:44, Gerriet M. Denkmann wrote:



On 16 Dec 2008, at 08:43, Brandon Walkin wrote:

The image is in /System/Library/CoreServices/CoreTypes.bundle/ 
Contents/Resources


This works fine:
NSImage *anImage = [ NSImage imageNamed: NSImageNameComputer ];

but how to get an image of a black MacBook? (My computer is white.)


NSImageNameComputer is the icon for the whatever computer is being  
used. In addition, the black MacBook was replaced in October, so do  
you really want to keep the old image? 
___


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: Where is the Computer Image ?

2008-12-15 Thread Benjamin Dobson

The image is already in Cocoa, named NSComputer.

On 15 Dec 2008, at 04:53:12, Gerriet M. Denkmann wrote:


Finder.app can show in its Sidebar an image of a computer.
I want to create a button with this same (or similar) image.

I can use [ sharedWorkspace iconForFile: fullPath ] to get an image  
of a home folder, or of a disk partition.


But I cannot find a computer image. Also looked at "Icon Services  
and Utilities Reference" but did not find anything there.



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

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


Re: Announce the time every 30 minutes

2008-12-12 Thread Benjamin Dobson

On 12 Dec 2008, at 18:36:21, has wrote:


You could run 'say `date`' as a cron job.


Make sure to specify your own date format. The user's default one will  
probably sound silly.


For example,

date "+The time now is %I:%m %p on %A %B %e %Y"

will return

The time now is 09:12 pm on Friday December 12 2008

The system voices will pick it up as a date and say "twelfth" instead  
of "twelve". Compare this with my default format:


Fri 12 Dec 2008 21:27:14 GMT

I had to listen to that several times to work out what it was saying.  
It is spoken ridiculously fast.


See date man page for more info.
___

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: Distributing apps

2008-12-10 Thread Benjamin Dobson


On 10 Dec 2008, at 18:15:51, Richard S. French wrote:

I have found a lot of Cocoa books and tutorials about writing  
applications.
I haven’t found any instructions as to how to put that application  
into an
icon that can be run when clicked on your desktop or downloaded by  
others.

Please let me know if I’ve missed it.
Thanks, Richard.


Write your application in Xcode, then click Build. This will produce  
an application bundle that can be run when double-clicked. For  
information on distributing your application in a form the Internet  
will work with, see http://developer.apple.com/documentation/developertools/conceptual/SoftwareDistribution/Introduction/chapter_1_section_1.html#/ 
/apple_ref/doc/uid/1145i-CH1-DontLinkElementID_69___


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 [EMAIL PROTECTED]


Re: Detecting the Enter Key

2008-12-10 Thread Benjamin Dobson
I would go for the second one. I would guess that the second one would  
pick up all the various Enter keys, whereas the first would only pick  
up a single key. The second also looks much more elegant to me. I do  
not have any experience with this; I am merely saying what looks best  
from my point of view.


On 10 Dec 2008, at 17:43:06, Eric Gorr wrote:


One way to check to see if the enter key has been pressed is to:

[theEvent keyCode] == 0x04C

where 0x04C is the keyCode corresponding to the enter key.
(Is there an Apple defined constant for this key code?)



Another way, found at:

http://developer.apple.com/samplecode/TrackBall/listing9.html

is to do:

NSString *characters = [theEvent characters];

switch ([characters characterAtIndex:0])
{
   case NSEnterCharacter:
   case NSNewlineCharacter:
   case NSCarriageReturnCharacter:
}



My question is which method is the preferred or recommended way to  
detect this key in onKeyDown?


Is there a better way?

Thank you.





___

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/importedfromspace%40googlemail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Return Control To Next Active App Without Hiding?

2008-12-10 Thread Benjamin Dobson

I haven't tested this, but could you use  [NSApp deactivate];?

On 10 Dec 2008, at 09:22:18, Chunk 1978 wrote:


the closest thing i've come to being able to bring front the most
recent app is using this:

[NSApp hide:self];
[NSApp unhideWithoutActivation];

but that flashes my app, and kinda looks like a glitch... is there any
standard method i can use to make this happen 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to launch window of the application on clicking of dock icon?

2008-12-09 Thread Benjamin Dobson


On 9 Dec 2008, at 17:02:19, Arun wrote:


Hi,

I have created a simple application in cocoa.
when it is ran, the main window appears and a default dock icon in  
the Dock.
If i close the window, the dock icon still stays. But if i click on  
the dock

icon then also the main window is visible.
The only way i can see the main window is by quitting the app and  
launching

it again. Is there any way in which upon clicking on the dock,
the application window becomes visible.

Thanks
Arun KA


I don't actually have an answer, but it sounds like the  
applicationShouldTerminateAfterLastWindowClosed: delegate method might  
be right for you. Although I am just guessing here.


http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#/ 
/apple_ref/occ/instm/NSObject/ 
applicationShouldTerminateAfterLastWindowClosed:

___

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 [EMAIL PROTECTED]


Re: Fixed width of left pane in NSSplitView

2008-12-08 Thread Benjamin Dobson


On 8 Dec 2008, at 08:03:51, Jushin wrote:


However, I have no idea how to do this. Should I create a subclass of
NSSplitView?


No. Just wire up a different object as the delegate for your split view.
___

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 [EMAIL PROTECTED]


Re: interact with users in a background app

2008-12-07 Thread Benjamin Dobson


On 8 Dec 2008, at 07:28:29, BirdSong wrote:

Thank you for your answer... But seems it doesn't work, the window  
still can not accept the key events...


Have you told it to makeKeyAndOrderFront:?
___

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 [EMAIL PROTECTED]


Re: 3-float struct?

2008-12-07 Thread Benjamin Dobson

On 7 Dec 2008, at 18:46:18, Dave DeLong wrote:


Hi everyone,

I was asked yesterday if there's a struct in Cocoa that has 3 float  
members.  The person asking me was looking for a struct that could  
contain a 3 dimensional point (so like a CG- or NSPoint, but with a  
z member).


My quick searches didn't reveal anything, but I was wondering if any  
of you knew of one.


Thanks,

Dave


Surely you could define one of your own?
___

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 [EMAIL PROTECTED]


Re: New to Cocoa and Objective C, and I need some basic pointers

2008-12-05 Thread Benjamin Dobson
The OP has sent me the original message body off-list. The rest of  
this message is what the original message was meant to say.


–––

I've been programming almost exclusively in Java since 1998, and  
between 1985 through 1998 I was using C and C++. I just started  
learning Objective C, and found the language pretty easy to use.  
However, I need some pointers on the best way to become familiar with  
some of the Cocoa libraries and classes as well as the Foundation.


In Java, they have  what I think is a great API reference for all the  
"normal" classes. For those of you that have never seen it, just so  
you'll know what I'm talking about, here's a link:


http://java.sun.com/javase/6/docs/api/

With this you look up the name of a class on the left column, click on  
it, and the detail regarding the class shows up on the main section of  
the page.


I'm new to this with Cocoa, and I've been looking for something  
similar to that above. I have found, for example, the "Foundation  
Reference Collection for Objective-C," the "Application Kit Objective- 
C Reference Collection," and a host of other similar type pages in the  
developers documentation. Each such page displays what can be long  
lists of classes, and if you click on one of the Class References, up  
comes a page with more detailed information. The information looks  
pretty decent, but I end up using the "back" button on the browser to  
navigate.


Is there a better, easier API layout? Additionally is there one that  
would include nearly all frameworks in one list?


Also, I've noticed that some of the newer Objective C texts are using  
the "dot" notation. Is this going to be the norm in the future or was  
this something added to make Objective C easier to port from Java, C+ 
+, and even C in some cases?


Last but not least, what are the best books available for learning  
Objective C and Cocoa? I've had little problems with Objective C  
(except adjusting to the notation) so I assume I would want to focus  
primarily on Cocoa, and I'm assuming any decent Cocoa book would  
probably delve into the Foundation as well, since I don't see how it  
couldn't (that's just my opinion).


All opinions welcome, 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 [EMAIL PROTECTED]


Re: New to Cocoa and Objective C, and I need some basic pointers

2008-12-05 Thread Benjamin Dobson

On 5 Dec 2008, at 21:26:49, [EMAIL PROTECTED] wrote:





Something wrong with your email?
___

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 [EMAIL PROTECTED]


Re: How to extract individual icons from icns file?

2008-12-04 Thread Benjamin Dobson


On 4 Dec 2008, at 20:58:29, I. Savant wrote:


 Great. Now open the newly-created file in Photoshop (as if you were
going to do something with it such as creating a branded folder or
something similar). :-)


Yes, I've noticed how bad Photoshop is with TIFFs. In Preview, File »  
Save As » Pretty much anything except TIFF, such as PNG, then open it  
in Photoshop. It's fine.___


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 [EMAIL PROTECTED]


Re: How to extract individual icons from icns file?

2008-12-04 Thread Benjamin Dobson


On 4 Dec 2008, at 20:33:37, I. Savant wrote:


On Thu, Dec 4, 2008 at 3:28 PM, Andy Lee <[EMAIL PROTECTED]> wrote:

Are you asking where Icon Composer is?  What happens if you type  
"icon

composer" into Spotlight?


 As I recall, the /Developer folder isn't automatically indexed by
Spotlight. At least it didn't used to be. I had to manually ask it to
index. Has that changed?


It was indexed automatically for me on Leopard.


 Anyway, there are various problems with trying to save images out of
Icon Composer and Preview. Try finding the standard folder icon and
extracting a clean image from it with either of those apps. Go on ...
I'll wait ... :-)


Did that; what's the problem? Open /System/Library/CoreServices/ 
CoreTypes.bundle/Contents/Resources/GenericFolderIcon.icns in preview  
and drag the top image onto the desktop. Nothing wrong that I can see.

___

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 [EMAIL PROTECTED]


Re: lid open and close notification

2008-12-04 Thread Benjamin Dobson

On 4 Dec 2008, at 18:29:26, sheen mac wrote:


Hi All,

In my app needs lid open and close notification.I used ioreg shell  
call
for that (ioreg -n IOPMrootDomain | grep AppleClamshellState | sed  
's/^.*=//'
).But when lid close and open it return "No". Always the  
clamshellstate is

true.Insomania.kext was loaded before close the lid.

Any other way to get this info?.

Kindly help me.

Thanks In Advance,
Sheen


I'm not familiar with this, but... how would you know the lid is  
closed? Wouldn't the computer be asleep?

___

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 [EMAIL PROTECTED]


Re: Special Characters Edit Menu Item

2008-12-03 Thread Benjamin Dobson


On 4 Dec 2008, at 04:17:22, Michael Ash wrote:


Consider that the special characters palette is system-wide, not
app-specific. A user may activate it in another app and then bring
yours up with the palette still available, even though it's not
appropriate. A user may also wish to activate it within your app
before switching to another app where it is appropriate, and will be
annoyed to find that you've removed the command.

Also consider that there's more to your app than just your code. For
example, it would be reasonable to use this palette to ender text into
the search box in the Help menu (although this doesn't actually work
on Leopard, it would seem) and there may be other text fields around
that you haven't explicitly created.


In addition to what Michael wrote, it is possible for the user to open  
the character palette from the Input Menu. It is impossible to stop  
the user getting at the character palette.

___

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 [EMAIL PROTECTED]


Re: Customizing menu drawing

2008-12-03 Thread Benjamin Dobson

I can offer you just two options:
– Use Aqua menus.
– Draw a custom view instead of a menu.

Other people may have more ideas.

On 3 Dec 2008, at 08:57:35, Joe Ranieri wrote:

I'm attempting to draw custom menus as part of a kiosk application  
where normal Mac OS X menus would look out of place.


I can customize drawing of the individual menu items using a custom  
view (through -[NSMenuItem setView:]). However, there remains a  
region above and below the items where I can't draw. So I'm left  
with a menu with portions of the aqua appearance, and portions of my  
appearance - which is definitely not what I'm after.


http://sirg3.homeip.net/tmp/menus.png

I have a hunch it can be done by dropping down into the Carbon menu  
manager, but that's not supported and will break in 64-bit... Does  
anyone have 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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Button title irregularities

2008-12-02 Thread Benjamin Dobson


On 3 Dec 2008, at 01:15:32, Randall Meadows wrote:

And I'm using that because that's what my client used on their  
iPhone app, and they want the Mac app to have the exact same look  
and feel.


Then why not use Helvetica?
___

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 [EMAIL PROTECTED]


Re: Text blurred in application

2008-11-29 Thread Benjamin Dobson
Make sure the PDF is not larger than the button and that it does not  
contain bitmaps.


On 28 Nov 2008, at 23:44:41, Richard Somers wrote:



On Nov 28, 2008, at 3:06AM, Adil Saleem wrote:

But the static text is not readable when application is launched.  
It is too blurred.


I have been using pdf files for NSButton images. Sometimes the  
images will be blurred. I have not figured it out yet.


Richard

___

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 [EMAIL PROTECTED]


Re: Text blurred in application

2008-11-28 Thread Benjamin Dobson

On 28 Nov 2008, at 10:06:28, Adil Saleem wrote:


Hi,

I am having a problem with the way my application displays text. In  
my application, i have some NSTextFields (static text) on a custom  
window of mine. But the static text is not readable when application  
is launched. It is too blurred. At first i thought it was because  
the text size is small, but then i checked it for larger text size  
and different fonts. But they all show same results. What is really  
strange is that the same appliation displays perfectly when an  
external monitor is connected with the MacBook, but text displays  
horribly when running on MacBook. I have verified this 3-4 MacBooks.  
It is not a problem with my MacBook. Any suggestions why it is  
happening and how can i remove this problem? Maybe it has got  
something to do with the drawing within the application, not sure.  
Please guide.


Thank You


make sure that Core Animation is turned off if you're running Leopard.  
Other than that, I don't know what advice I can give you.

___

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 [EMAIL PROTECTED]


Re: Preventing a user from moving a window

2008-11-26 Thread Benjamin Dobson

On 26 Nov 2008, at 03:28:11, Damien Cooke wrote:


Hi all,
I have an arrangement of windows that I do not want the user to  
move.  What is the best way of doing this.  There are several ways I  
thought of but they are not very elegant.  Can someone point me in  
the right direction?


Regards
Damien


You could use the windowWillMove: delegate method, and reset the  
position of the window while the user is trying to move it. It's not  
ideal, but it should work (I haven't tested 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 [EMAIL PROTECTED]


Re: NSPopupUpButton not showing checked menu items

2008-11-23 Thread Benjamin Dobson
Actually, I only wanted to select a single item in the pulldown  
case, the same as what correctly happens for me in the popup case.  
The problem has always been that, even though the button itself is  
reporting that a particular item is "selected," none of the  
underlying NSMenuItems' state is ever set to anything other than  
where it was left in IB (which is typically NSOffState). And so a  
check mark is never set next to the most-recently selected menu item.


I'm still wondering why you're using a pull down menu, not a pop up one.
___

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 [EMAIL PROTECTED]


Re: Finder's sidebar background color

2008-11-16 Thread Benjamin Dobson
Well, it is kind of a source list (a list of command descriptions).  
It is hard to explain in words, please take a look at the link to  
OnMyCommand I've posted earlier.


However, I do think it really fits its purpose :D


I agree, but I don't understand why a real source list doesn't do what  
you want.

___

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 [EMAIL PROTECTED]


Re: NSGraphiteControlTint in app

2008-11-10 Thread Benjamin Dobson
At a guess, [[[yourWindow standardWindowButton:NSWindowCloseButton]  
cell] setControlTint:NSGraphiteControlTint];

Repeat for each window button.

On 10 Nov 2008, at 07:51:23, Ralph Manns wrote:


Hello,
I don't think the method setControlTint is the solution I'm looking  
for,
because only a few classes have such a method, NSWindow doesn't.  
Maybe my

question was to general.

Is there a way without using private methods to set the complete  
appearance
of an application to NSGraphiteControlTint, although the control  
tint in

System Preference is set to NSBlueControlTint.

I understand how important the appearance is to mac apps. But the
NSGraphiteControlTint is used by some apps to give them a "pro-app"
appearance. Do you really drag Apples "pro-apps" like Aperture into  
the

trash, because they look different? ;-)
I think for some few apps it is okay to violate the "Aqua-HIG".  
Aperture for

example wouldn't look so great with a blue aqua appearance.

Thanks, Ralph.


___

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 [EMAIL PROTECTED]


Getting started with NSTableView

2008-11-07 Thread Benjamin Dobson

Hi all,

I'm trying to use an NSTableView for the first time. I've got a four- 
column table view set up in IB, and class files for the dataSource as  
follows:


.h:
@interface ShowResults : NSObject {
IBOutlet id theTable;

@private
NSMutableArray *finalData;
NSMutableArray *currentData;
}

- (IBAction)fetchResults:(id)sender;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn: 
(NSTableColumn *)aTableColumn	row:(int)rowIndex;
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject  
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;

- (int)numberOfRowsInTableView:(NSTableView *)aTableView;

@end

.m:
@implementation FetchHighscores

- (IBAction)fetchResults:(id)sender
{
	finalData = [NSMutableArray arrayWithCapacity:4]; // To prevent it  
being (null)
	NSString *string = @"1,1,1 2,2,2 3,3,3 4,5,6 7,3,4" // etc. Loaded  
from an external source.

NSArray *components = [results componentsSeparatedByString:@"\n"];
	NSArray *template = [NSArray arrayWithObjects:@"Col1", @"Col2",  
@"Col3", @"Col4", nil];

int loops = [components count];
int loop;
for (loop = 0; loop < loops; loop++)
{
currentData = [NSMutableArray arrayWithCapacity:4];
[currentData addObject:@"0"];
		[currentData addObjectsFromArray:[[scores objectAtIndex:loop]  
componentsSeparatedByString:@","]];
		while ([currentData count] < 4) // External source isn't entirely  
consistent. This is just a placeholder.

{
[currentData addObject:@"0"];
}
		NSDictionary *dict = [NSDictionary dictionaryWithObjects:currentData  
forKeys:template];

[finalScores insertObject:dict atIndex:loop];
}
[theTable reloadData];
}


// Code below is modified from Apple's website.
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
id theRecord, theValue;

NSParameterAssert(rowIndex >= 0 && rowIndex < [finalData count]);
theRecord = [finalData objectAtIndex:rowIndex]; // Error
theValue = [theRecord objectForKey:[aTableColumn identifier]]; //  
Error

return theValue;
}

- (void)tableView:(NSTableView *)aTableView
   setObjectValue:anObject
   forTableColumn:(NSTableColumn *)aTableColumn
  row:(int)rowIndex
{
id theRecord;

NSParameterAssert(rowIndex >= 0 && rowIndex < [finalData count]);
theRecord = [finalData objectAtIndex:rowIndex];
[theRecord setObject:anObject forKey:[aTableColumn identifier]];
return;
}

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [finalData count];
}

@end

I'm getting strange errors. In the console, I get:
*** -[NSRectSet objectAtIndex:]: unrecognized selector sent to  
instance 0x1516c220


But sometimes I get a different error: the NSParameterAssert isn't  
satisfied.


What needs changing?

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 [EMAIL PROTECTED]


Re: Creating icons and other resources

2008-10-25 Thread Benjamin Dobson

On 25 Oct 2008, at 17:03:54, [EMAIL PROTECTED] wrote:

I hope this is appropriate the list, if not, my apologies. I was  
wondering how people go about creating the artwork that goes into  
their applications. I don't have a professional budget, and do  
things myself, but I'm not an artist, so my creative skills are  
limited. I see many of the apps listed on sites like Version Tracker  
and Mac-Update have pretty 3D icons for the app and nicely done  
artwork for windows and preference panes. So, I'm wondering how do  
folks get your ideas and what tools do you use to bring them to life.

Thanks, and apologies again if this question was not appropriate.


This discussion came up quite recently.

http://www.cocoabuilder.com/archive/message/cocoa/2008/10/19/220489
___

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 [EMAIL PROTECTED]


Re: Controls disappearing from window during resize

2008-10-23 Thread Benjamin Dobson
Any particular reason you want to scale to zero? Because if not, why  
not just give the window a minimum size?


I see the problem. It seems like a bug. But allowing the custom view  
to scale into negative dimensions just seems... wrong.

___

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 [EMAIL PROTECTED]


Re: WebView: Open new windows in default browser

2008-10-23 Thread Benjamin Dobson
On 23 Oct 2008, at 01:09:07, <[EMAIL PROTECTED]> <[EMAIL PROTECTED] 
> wrote:


I've been trying to get a WebView to open in the user's default  
browser. In fact, I've succeeded, but it's rather clunky,

and I'm wondering if there's a better way.


Why not simply add "target=_'blank'" to your URLs? No WebView  
hacking needed.


http://my.external.url"; title="What the user sees"  
target="_blank">


Sorry – you misunderstand. I meant a way to change the way WebView  
handles opening windows to open them in the user's default browser.  
Like I said, I have found a way to do this, but it involves a second  
WebView which intercepts the message and passes it to the default  
browser with [[NSWorkspace sharedWorkspace] openURL:[request URL]];


As such, it doesn't really matter if there is no other way to do this,  
but a better method would be an improvement.___


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 [EMAIL PROTECTED]


WebView: Open new windows in default browser

2008-10-22 Thread Benjamin Dobson

Hi all,

I've been trying to get a WebView to open in the user's default  
browser. In fact, I've succeeded, but it's rather clunky, and I'm  
wondering if there's a better way.


At the moment, this is what I do:

My main WebView's method for opening windows is controlled via  
UIDelegate. These requests are passed on to a second WebView, which  
intercepts all requests via policyDelegate. It then passes them on to  
the default browser with the openURL: method in NSWorkspace.


This works fine. If there is a better way you know of, please tell me,  
but if not, don't worry.

___

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 [EMAIL PROTECTED]


Re: Custom button cells for NSMatrix

2008-10-20 Thread Benjamin Dobson

Highlighting each cell in a matrix will let you change the image for it.

On 20 Oct 2008, at 12:19:04, norio wrote:


Hi,

I'm trying to make a custom cell object for NSMatrix which behaves  
like radio button, this is, when you press the second cell, the  
second cell is highlighting still.


Would you tell me which method I need to override?

Thank you.

Norio


___

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 [EMAIL PROTECTED]


  1   2   >