Re: NSTask curl

2009-06-07 Thread Dave Camp

On Jun 6, 2009, at 3:18 PM, Ammar Ibrahim wrote:


On Sun, Jun 7, 2009 at 1:09 AM, Bill Bumgarner b...@mac.com wrote:


On Jun 6, 2009, at 3:05 PM, Ammar Ibrahim wrote:

Thanks that fixed it! Although when you call it directly from the  
command

line, it's fine to have the space there!



I'd argue that fixed a symptom, but not the problem.

As others have said, launching a task to execute curl is just about  
as

wasteful and inefficient as you can get.

What others haven't mentioned is that it is also a potential  
security hole
or source of confusion for your users.  Namely, packing up command  
lines and

then executing sub shells is rife with fragility and security issues.


I do agree, but I really need to use curl, and this is not a  
product. It's

for a controlled environment. I will entirely replace curl later.


If you really need to use curl, you should probably link against  
libcurl and use the code directly. The API is quite easy to work with.


Dave
___

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

Please do not post 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


Using non-id sender in IBAction methods

2009-06-07 Thread Marc Liyanage


With the new dot notation I sometimes use explicit types in my  
IBAction methods:


- (IBAction)doSomething:(UIButton *)button ...

instead of

- (IBAction)doSomething:(id)sender ...

so I don't have to downcast sender to be able to use the dot notation.

Do others do this too? Is this discouraged for some reason?



___

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

Please do not post 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


NSOutlineView and tags...

2009-06-07 Thread Scott Andrew
This may sound like a newbie questions but never had this issue  
before..  I am trying to add a tag ID to an NSOutlineView thats in one  
view controller. In another view controller is a table view. I listen  
to NSOutlineViewSelectionDidChange notifications and fill the table  
based on the selection. This listens to all outline views (even the  
open file panel). So i put a tag id on my NSOutlineView and wanted to  
check for that particular tag. But it always comes up 0. I have a work  
around for this by listening for selection changes in the tree  
controller and firing off a notification based on what was actually  
selected.


I am now just curious about the NSOutlineView and the tag field. I  
couldn't find anything that said you couldn't tag a outline or table  
view control.


Scott Andrew
___

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

Please do not post 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: NSOutlineView and tags...

2009-06-07 Thread Keary Suska

On Jun 7, 2009, at 9:54 AM, Scott Andrew wrote:

This may sound like a newbie questions but never had this issue  
before..  I am trying to add a tag ID to an NSOutlineView thats in  
one view controller. In another view controller is a table view. I  
listen to NSOutlineViewSelectionDidChange notifications and fill the  
table based on the selection. This listens to all outline views  
(even the open file panel). So i put a tag id on my NSOutlineView  
and wanted to check for that particular tag. But it always comes up  
0. I have a work around for this by listening for selection changes  
in the tree controller and firing off a notification based on what  
was actually selected.


I am now just curious about the NSOutlineView and the tag field. I  
couldn't find anything that said you couldn't tag a outline or table  
view control.


First off, how are you setting the tag, and what value are you  
setting? How are you checking the tag (show code)? I haven't heard or  
experienced any issues with NSOutlineView and tags, but if you have a  
reducible/reproducible case, you can file a bug.


Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business

___

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

Please do not post 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: Using non-id sender in IBAction methods

2009-06-07 Thread Ken Thomases

On Jun 7, 2009, at 10:45 AM, Marc Liyanage wrote:

With the new dot notation I sometimes use explicit types in my  
IBAction methods:


- (IBAction)doSomething:(UIButton *)button ...

instead of

- (IBAction)doSomething:(id)sender ...

so I don't have to downcast sender to be able to use the dot  
notation.


Do others do this too? Is this discouraged for some reason?


It's legitimate to do, but there's a trade-off: generality.

In theory, action methods may be invoked by a variety of types of  
senders.  The same action might be invoked by a menu item, a button, a  
toolbar item, a text field, etc.  You might not now anticipate the  
future use of an action method.


So, you can do what you describe, but it does limit the potential  
usefulness of the action methods you design.


On the other hand, many of the things you might do with the sender  
will require that you know the type of the sender, so it might not  
matter.  That is, most truly general action methods will either not  
make use of the sender or will invoke only very generic methods of the  
sender (e.g. -tag).  If you're writing an action method that really  
gets into the specifics of its sender, then that action is probably  
only meaningful with that particular type of sender, anyway.


In short, it's a design decision with no right answer.  Understand the  
trade-off and make whatever choice is appropriate for your application.


Cheers,
Ken

___

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

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

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

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


NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Martin Batholdy

hi,


I have an IBOutlet defined in my header;

IBOutlet NSTabView *tabView;


This Outlet is connected with a TabView generated with Interface  
Builder.


The TabView has two tabs,
and in my implementation file I want to do something when tab1 is  
active and something else when tab2 is active.


I tried the following;

NSTabViewItem *tabViewItemX;
tabViewItemX = [tabView selectedTabViewItem];

if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){
NSLog(@1);
} else{
NSLog(@2);
}

But it doesn't work properly. It is just always 2.

What do I wrong?



thanks!

___

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

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

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

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


Re: NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Greg Guerin

Martin Batholdy wrote:


if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){


Don't use isEqualTo: in this situation.  Read the docs for  
isEqualTo:, and compare with the docs for isEqual:.


Use isEqual:, which I suspect will work, or just use == since you're  
probably interested in actual pointer equality.


  -- GG

___

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

Please do not post 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


NSMenuItem with CustomView - strange behavior

2009-06-07 Thread Peter Krajcik

Hello,

I ma trying to mimic a grey color look of menus like in Apple Pro Apps.
I found a way how to change a background color of menu (top and bootom  
caps) and using custom View
in NSMenuItem I can do what I need in NSView in a place of NSMenuItem  
(background, text, image).
I am using this menu with NSPopButton and there are two problems I  
can't figure out:
1. when I open menu in NSPopUpButton, menu closes on MouseUp event in  
a parent window - Should on MouseDown (actually, menu is recieving  
cancelTracking on MouseUp, but should on MouseDown). If I set this  
NSPopUpButton to [self setPullsDown:YES] it works (Menu closes at  
MouseDown)
2. I am highliting my NSViews checking for [[self enclosingMenuItem]  
isHighlighted]. The problem is that when menu is open for the first  
time, and let's say, menu item 1 with my NSView is highlighted, it  
doesn't recieve -(void)drawRect:(NSRect) rect message whn mouse moves  
to enother item. So, it stays highlighted. When I move mouse back to  
this item 1, and then to another item, item now recieves  - 
(void)drawRect:(NSRect) rect message and unhighlighte itself.

The first problem is present also in Apple sample (MenuItemView).
Does anybody know a workaround ?
Thank you.



Peter
___

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

Please do not post 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: NSOutlineView and tags...

2009-06-07 Thread Scott Andrew
Chalk this up to me having two copies of the project around and having  
one of those moments..


Scott

On Jun 7, 2009, at 9:47 AM, Keary Suska wrote:


On Jun 7, 2009, at 9:54 AM, Scott Andrew wrote:

This may sound like a newbie questions but never had this issue  
before..  I am trying to add a tag ID to an NSOutlineView thats in  
one view controller. In another view controller is a table view. I  
listen to NSOutlineViewSelectionDidChange notifications and fill  
the table based on the selection. This listens to all outline views  
(even the open file panel). So i put a tag id on my NSOutlineView  
and wanted to check for that particular tag. But it always comes up  
0. I have a work around for this by listening for selection changes  
in the tree controller and firing off a notification based on what  
was actually selected.


I am now just curious about the NSOutlineView and the tag field. I  
couldn't find anything that said you couldn't tag a outline or  
table view control.


First off, how are you setting the tag, and what value are you  
setting? How are you checking the tag (show code)? I haven't heard  
or experienced any issues with NSOutlineView and tags, but if you  
have a reducible/reproducible case, you can file a bug.


Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business

___

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

Please do not post 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/scottandrew%40roadrunner.com

This email sent to scottand...@roadrunner.com


___

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

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

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

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


Re: Using non-id sender in IBAction methods

2009-06-07 Thread Uli Kusterer

Am 07.06.2009 um 08:45 schrieb Marc Liyanage:
With the new dot notation I sometimes use explicit types in my  
IBAction methods:


- (IBAction)doSomething:(UIButton *)button ...

instead of

- (IBAction)doSomething:(id)sender ...

so I don't have to downcast sender to be able to use the dot  
notation.


Do others do this too? Is this discouraged for some reason?



 Not a good idea. The sender can be pretty much any object. It might  
not be right now, but IBActions are often hooked up to several  
objects, like a toolbar item, a pushbutton and a menu item. Hence the  
definition as id. By leaving it as id and then typecasting, the  
assumption becomes explicit in the code. By having it as another type  
right away, you're kind of masking the issue.


 I recommend you write it as:

-(IBAction) doSomething: (id)sender
{
NSAssert( [sender isKindOfClass: [UIButton class]] );
UIButton*senderBtn = (UIButton*)sender;

// use btn here...
}

Or at least put an assert in there if you feel you need an IBAction  
with a non-ID parameter type. The details of the assert are not as  
important. In fact, if you can, use [sender respondsToSelector:  
@selector(whateverYouAreCalling:)] or so instead of -isKindOfClass:.  
The point of the assert is to make your code fail in a noticeable way  
when someone breaks the assumptions it makes.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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

Please do not post 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


How to detect a click on app's dock icon (when the app is active)?

2009-06-07 Thread Stuart Malin
I have a non Document based app. If the window is closed, I want to  
have the user be able to get it back by clicking on the dock icon.  
(Note that Apple's Mail does this). I have implemented NSApplication's

- (void) applicationDidBecomeActive:(NSNotification *)notif
but that is only invoked if the dock icon is clicked when the app is  
not active. I need to know when it is clicked while the app is active.  
I've looked through various docs, searched with Google, and on  
Cocoabuilder, but the answer has eluded me. 
___


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

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

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

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


Re: How to detect a click on app's dock icon (when the app is active)?

2009-06-07 Thread Andy Lee

On Jun 7, 2009, at 8:50 PM, Stuart Malin wrote:
I have a non Document based app. If the window is closed, I want to  
have the user be able to get it back by clicking on the dock icon.  
(Note that Apple's Mail does this). I have implemented NSApplication's

- (void) applicationDidBecomeActive:(NSNotification *)notif


Instead of that, implement these:

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender;

- (BOOL)applicationOpenUntitledFile:(NSApplication *)theApplication;

Have the first one return YES and have the second one reopen your  
window.  They work even in a non-document-based app.


--Andy




but that is only invoked if the dock icon is clicked when the app is  
not active. I need to know when it is clicked while the app is  
active. I've looked through various docs, searched with Google, and  
on Cocoabuilder, but the answer has eluded  
me.___


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

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

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

This email sent to ag...@mac.com


___

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

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

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

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


Re: Using non-id sender in IBAction methods

2009-06-07 Thread Bryan Henry
I hope you aren't suggesting that he use assertions in production code  
- that's much worse practice than specifying a non-id parameter for an  
action method.


As someone already said, if your action method is specific enough to  
the type of sender object where specifying it's type keeps you from  
casting, it's unlikely that you're going to have sender objects of  
different types.


- Bryan

Sent from my iPhone

On Jun 7, 2009, at 4:05 PM, Uli Kusterer  
witness.of.teacht...@gmx.net wrote:



Am 07.06.2009 um 08:45 schrieb Marc Liyanage:
With the new dot notation I sometimes use explicit types in my  
IBAction methods:


- (IBAction)doSomething:(UIButton *)button ...

instead of

- (IBAction)doSomething:(id)sender ...

so I don't have to downcast sender to be able to use the dot  
notation.


Do others do this too? Is this discouraged for some reason?



Not a good idea. The sender can be pretty much any object. It might  
not be right now, but IBActions are often hooked up to several  
objects, like a toolbar item, a pushbutton and a menu item. Hence  
the definition as id. By leaving it as id and then typecasting,  
the assumption becomes explicit in the code. By having it as another  
type right away, you're kind of masking the issue.


I recommend you write it as:

-(IBAction) doSomething: (id)sender
{
   NSAssert( [sender isKindOfClass: [UIButton class]] );
   UIButton*senderBtn = (UIButton*)sender;

   // use btn here...
}

Or at least put an assert in there if you feel you need an IBAction  
with a non-ID parameter type. The details of the assert are not as  
important. In fact, if you can, use [sender respondsToSelector:  
@selector(whateverYouAreCalling:)] or so instead of -isKindOfClass:.  
The point of the assert is to make your code fail in a noticeable  
way when someone breaks the assumptions it makes.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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

Please do not post 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/bryanhenry%40mac.com

This email sent to bryanhe...@mac.com

___

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

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

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

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


Re: How to detect a click on app's dock icon (when the app is active)?

2009-06-07 Thread Stuart Malin


On Jun 7, 2009, at 3:05 PM, Andy Lee wrote:


On Jun 7, 2009, at 8:50 PM, Stuart Malin wrote:
I have a non Document based app. If the window is closed, I want to  
have the user be able to get it back by clicking on the dock icon.  
(Note that Apple's Mail does this). I have implemented  
NSApplication's

- (void) applicationDidBecomeActive:(NSNotification *)notif


Instead of that, implement these:

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender;

- (BOOL)applicationOpenUntitledFile:(NSApplication *)theApplication;

Have the first one return YES and have the second one reopen your  
window.  They work even in a non-document-based app.




Thanks, Andy; works!

Q: I presume it doesn't matter what value is returned for - 
applicationOpenUntitledFile  (I happen to be returning NO because no  
file was opened).




but that is only invoked if the dock icon is clicked when the app  
is not active. I need to know when it is clicked while the app is  
active. I've looked through various docs, searched with Google, and  
on Cocoabuilder, but the answer has eluded  
me.___


___

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

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

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

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


Re: Using non-id sender in IBAction methods

2009-06-07 Thread Andy Lee

On Jun 7, 2009, at 9:09 PM, Bryan Henry wrote:
I hope you aren't suggesting that he use assertions in production  
code - that's much worse practice than specifying a non-id parameter  
for an action method.


Well, you can configure your build to strip NSAssert from Release  
code, if that isn't the default already.  I assume Uli meant this as a  
debugging aid.


As someone already said, if your action method is specific enough to  
the type of sender object where specifying it's type keeps you from  
casting, it's unlikely that you're going to have sender objects of  
different types.


I never thought of trying this before, but it seems that having a more  
narrowly defined sender also limits the kind of controls IB lets you  
connect *from*, at least in the Cocoa IB and presumably in the iPhone  
IB as well.


--Andy





- Bryan

Sent from my iPhone

On Jun 7, 2009, at 4:05 PM, Uli Kusterer  
witness.of.teacht...@gmx.net wrote:



Am 07.06.2009 um 08:45 schrieb Marc Liyanage:
With the new dot notation I sometimes use explicit types in my  
IBAction methods:


- (IBAction)doSomething:(UIButton *)button ...

instead of

- (IBAction)doSomething:(id)sender ...

so I don't have to downcast sender to be able to use the dot  
notation.


Do others do this too? Is this discouraged for some reason?



Not a good idea. The sender can be pretty much any object. It might  
not be right now, but IBActions are often hooked up to several  
objects, like a toolbar item, a pushbutton and a menu item. Hence  
the definition as id. By leaving it as id and then typecasting,  
the assumption becomes explicit in the code. By having it as  
another type right away, you're kind of masking the issue.


I recommend you write it as:

-(IBAction) doSomething: (id)sender
{
  NSAssert( [sender isKindOfClass: [UIButton class]] );
  UIButton*senderBtn = (UIButton*)sender;

  // use btn here...
}

Or at least put an assert in there if you feel you need an IBAction  
with a non-ID parameter type. The details of the assert are not as  
important. In fact, if you can, use [sender respondsToSelector:  
@selector(whateverYouAreCalling:)] or so instead of - 
isKindOfClass:. The point of the assert is to make your code fail  
in a noticeable way when someone breaks the assumptions it makes.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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

Please do not post 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/bryanhenry%40mac.com

This email sent to bryanhe...@mac.com

___

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

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

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

This email sent to ag...@mac.com


___

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

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

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

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


Re: NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Scott Andrew
Why not use unique identifiers for each tab item? Each NSTabViewItem  
has an identifier value. Using that and some defines you can use do  
the following:


#define GENERAL_TAB 1
#define FONT_TAB 2

NSTabViewItem* tabViewItem = [tabView selectedTabViewItem];

switch([tabViewItem identifier])
{
case GENERAL_TAB:
NSLog(@1);
break;

case FONT_TAB
NSLog(@2);
break;
}


Scott


On Jun 7, 2009, at 11:14 AM, Martin Batholdy wrote:


hi,


I have an IBOutlet defined in my header;

IBOutlet NSTabView *tabView;


This Outlet is connected with a TabView generated with Interface  
Builder.


The TabView has two tabs,
and in my implementation file I want to do something when tab1 is  
active and something else when tab2 is active.


I tried the following;

NSTabViewItem *tabViewItemX;
tabViewItemX = [tabView selectedTabViewItem];

if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){
NSLog(@1);
} else{
NSLog(@2);
}

But it doesn't work properly. It is just always 2.

What do I wrong?



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/scottandrew%40roadrunner.com

This email sent to scottand...@roadrunner.com


___

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

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

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

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


Re: How to detect a click on app's dock icon (when the app is active)?

2009-06-07 Thread Andy Lee

On Jun 7, 2009, at 9:17 PM, Stuart Malin wrote:
Q: I presume it doesn't matter what value is returned for - 
applicationOpenUntitledFile  (I happen to be returning NO because no  
file was opened).


I don't know, but my guess is that if it seems to work, you can assume  
it works.  Maybe a document-based app would display an alert if that  
method returns NO?


--Andy


___

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

Please do not post 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: NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Andy Lee
Well, [tabViewItem identifier] returns an id, not an int, but the  
general idea is probably a good one -- decide your action based on the  
identifier rather than the position of the tab, in case you decide to  
rearrange the tabs later.


--Andy


On Jun 7, 2009, at 9:36 PM, Scott Andrew wrote:

Why not use unique identifiers for each tab item? Each NSTabViewItem  
has an identifier value. Using that and some defines you can use do  
the following:


#define GENERAL_TAB 1
#define FONT_TAB 2

NSTabViewItem* tabViewItem = [tabView selectedTabViewItem];

switch([tabViewItem identifier])
{
case GENERAL_TAB:
NSLog(@1);
break;

case FONT_TAB
NSLog(@2);
break;
}


Scott


On Jun 7, 2009, at 11:14 AM, Martin Batholdy wrote:


hi,


I have an IBOutlet defined in my header;

IBOutlet NSTabView *tabView;


This Outlet is connected with a TabView generated with Interface  
Builder.


The TabView has two tabs,
and in my implementation file I want to do something when tab1 is  
active and something else when tab2 is active.


I tried the following;

NSTabViewItem *tabViewItemX;
tabViewItemX = [tabView selectedTabViewItem];

if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){
NSLog(@1);
} else{
NSLog(@2);
}

But it doesn't work properly. It is just always 2.

What do I wrong?



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/scottandrew%40roadrunner.com

This email sent to scottand...@roadrunner.com


___

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

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

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

This email sent to ag...@mac.com


___

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

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

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

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


Re: NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Scott Andrew

Duh.. So a bit of correction to my code.

#define GENERAL_TAB 100
#define FONT_TAB 101

NSTabViewItem* item = [tabView selectedTabViewItem];

switch ([[item identifier] intValue])
{
case GENERAL_TAB:
NSLog(@Tab 1);
break;

case FONT_TAB:
NSLog(@Tab 2);
break;
}   
}

On Jun 7, 2009, at 6:54 PM, Andy Lee wrote:

Well, [tabViewItem identifier] returns an id, not an int, but the  
general idea is probably a good one -- decide your action based on  
the identifier rather than the position of the tab, in case you  
decide to rearrange the tabs later.


--Andy


On Jun 7, 2009, at 9:36 PM, Scott Andrew wrote:

Why not use unique identifiers for each tab item? Each  
NSTabViewItem has an identifier value. Using that and some defines  
you can use do the following:


#define GENERAL_TAB 1
#define FONT_TAB 2

NSTabViewItem* tabViewItem = [tabView selectedTabViewItem];

switch([tabViewItem identifier])
{
case GENERAL_TAB:
NSLog(@1);
break;

case FONT_TAB
NSLog(@2);
break;
}


Scott


On Jun 7, 2009, at 11:14 AM, Martin Batholdy wrote:


hi,


I have an IBOutlet defined in my header;

IBOutlet NSTabView *tabView;


This Outlet is connected with a TabView generated with Interface  
Builder.


The TabView has two tabs,
and in my implementation file I want to do something when tab1 is  
active and something else when tab2 is active.


I tried the following;

NSTabViewItem *tabViewItemX;
tabViewItemX = [tabView selectedTabViewItem];

if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){
NSLog(@1);
} else{
NSLog(@2);
}

But it doesn't work properly. It is just always 2.

What do I wrong?



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/scottandrew%40roadrunner.com

This email sent to scottand...@roadrunner.com


___

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

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

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

This email sent to ag...@mac.com




___

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

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

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

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


selecting tab in a tabless NSTabView in IB

2009-06-07 Thread Stephen Blinkhorn

Hello Cocoa Dev,

Does anyone know if it is possible to change the current tab in a  
tabless NSTabView from within Interface Builder without having to go  
into the inspector and change tabless style to top tabs, right tabs  
etc.  I use a lot of small tabless NSTabView objects and I finally got  
tired of going into the inpspector and switching view style.


Thanks,
Stephen
___

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

Please do not post 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: Backtabbing into an NSTableView

2009-06-07 Thread Vadim
An update on this question.  It turns out the first bit of code does  
not work after all, because 48 is the keyCode for [Tab] and [Shift 
+Tab].  I needed to change the code to the following:


-(void)keyDown:(NSEvent *)theEvent
{
	if ([theEvent keyCode] == 48  ([theEvent modifierFlags]   
NSShiftKeyMask)) // 48 is the tab key

{
		[self editColumn:1 row:[self selectedRow] withEvent:nil  
select:YES];		

return;
}
[super keyDown:theEvent];
}

Without the return; there is a bing.  To tell the truth, I'm not  
sure why I get the bing.  I'm guessing that it has something to do  
with the responder chain, but the thing is, the table can respond to  
a backtab.


The second bit of code (Code B) works, but it gives a bing at  
every keypress.  Again, I'm thinking this has something to do with  
the responder chain; but I'm not clear what.  Any ideas?


According to the documentation, beeping is a standard reaction to  
unhandled key event:
http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#/ 
/apple_ref/doc/uid/1060i-CH3-SW26

___

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

Please do not post 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


Shadow is inside of the object. After Clipping object does not show.

2009-06-07 Thread Agha Khan

Hi:

I have a Hexagon where I have filled a solid color and it is working.  
Now I placed a shadow which is showing in side of hexagon, which it  
should not. Very strange.


Second I wanted to clip that hexagon so outside of this hexagon (I  
used path to make that object) should not be dragged. When I use  
CGContextClip(context); then hexagon does not show.


I am developing IPhone application.

Any help will be very much appreciated.

Best regards
Agha Khan

___

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

Please do not post 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: selecting tab in a tabless NSTabView in IB

2009-06-07 Thread Rob Keniger


On 06/06/2009, at 6:08 AM, Stephen Blinkhorn wrote:

Does anyone know if it is possible to change the current tab in a  
tabless NSTabView from within Interface Builder without having to go  
into the inspector and change tabless style to top tabs, right tabs  
etc.  I use a lot of small tabless NSTabView objects and I finally  
got tired of going into the inpspector and switching view style.



Just switch the main object view in IB to one of the hierarchical  
options, you can then navigate to your tab view items and double-click  
them to edit the contents.


--
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: selecting tab in a tabless NSTabView in IB

2009-06-07 Thread Jonathan Hess


On Jun 7, 2009, at 9:13 PM, Rob Keniger wrote:



On 06/06/2009, at 6:08 AM, Stephen Blinkhorn wrote:

Does anyone know if it is possible to change the current tab in a  
tabless NSTabView from within Interface Builder without having to  
go into the inspector and change tabless style to top tabs, right  
tabs etc.  I use a lot of small tabless NSTabView objects and I  
finally got tired of going into the inpspector and switching view  
style.



Just switch the main object view in IB to one of the hierarchical  
options, you can then navigate to your tab view items and double- 
click them to edit the contents.


Also try shift+right-click or control+shift+click on the tab view  
right in the editor window for a list of all objects under the mouse.


Good Luck -
Jon Hess



--
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/jhess%40apple.com

This email sent to jh...@apple.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