Re: addTarget: forControlEvents: ?

2015-04-08 Thread Uli Kusterer
On 07 Apr 2015, at 21:49, Dave  wrote:
> Given the iOS/Cocoa-Touch code:
> 
> [self addTarget:self action:@selector(buttonTouchUpInsideAction:) 
> forControlEvents:UIControlEventTouchUpInside];
> [self addTarget:self action:@selector(buttonTouchDownAction:) 
> forControlEvents:UIControlEventTouchDownInside];

I presume you mean to react both to mouseDown and mouseUp events? Not touch 
gestures on the trackpad? You'd have to subclass NSButton and override 
NSResponder's mouseDown: and mouseUp: methods. buttons on OS X support neither 
multiple target/action pairs on one object, nor do they let you control when 
they send their action. They will always send it on a mouseUp: with the mouse 
inside the button.

Whatever you do, also keep in mind that full keyboard access and accessibility 
(the latter also on iOS) let you trigger buttons without using the mouse, so if 
you assume your mouseUp: action will always trigger after a mouseDown:, you may 
get a surprise with users who trigger them without the mouse (e.g. by tabbing 
and using the space key, or pressing the return key to trigger a default 
button).

Cheers,
-- Uli
___

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

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

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

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

Finder not responding to [NSRunningApplication activateWithOptions]

2015-04-08 Thread Tomáš Znamenáček
Hello!

I’m trying to bring the Finder window to front:

NSRunningApplication *finder = [NSRunningApplication
runningApplicationWithProcessIdentifier:finderPID];
[finder activateWithOptions:NSApplicationActivateIgnoringOtherApps];

This works on the primary, built-in display. But on my external display,
the Finder window doesn’t get focused after calling -activateWithOptions.
NSApplicationActivateAllWindows doesn’t change anything.

Is that the expected behaviour? Is it a bug?

Thank you,

T.
___

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

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

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

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

Re: Finder not responding to [NSRunningApplication activateWithOptions]

2015-04-08 Thread dangerwillrobinsondanger


> On 2015/04/08, at 22:53, Tomáš Znamenáček  wrote:
> 
> I’m trying to bring the Finder window to front:
> 
> NSRunningApplication *finder = [NSRunningApplication
> runningApplicationWithProcessIdentifier:finderPID];
> [finder activateWithOptions:NSApplicationActivateIgnoringOtherApps];
> 
> This works on the primary, built-in display. But on my external display,
> the Finder window doesn’t get focused after calling -activateWithOptions.
> NSApplicationActivateAllWindows doesn’t change anything.
> 
> Is that the expected behaviour? Is it a bug?
So you can only have one window focused as it were even with multiple displays. 
But there's a little weirdness now with having additional displays have their 
own menu bar. 
Can you say more about what happens?
There's definitely also a spaces like behavior to what display is currently 
main. 
___

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

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

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

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

Re: Finder not responding to [NSRunningApplication activateWithOptions]

2015-04-08 Thread Tomáš Znamenáček
I should have mentioned that Finder behaves unlike other apps in this
regard. If I do the same with any other app, the app is correctly focused,
stealing focus from whatever app was focused before. (And the menu bar on
the display “gets focus”, too. Gets opaque, anyway.)

T.
___

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

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

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

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

Re: Finder not responding to [NSRunningApplication activateWithOptions]

2015-04-08 Thread Ken Thomases
On Apr 8, 2015, at 9:19 AM, Tomáš Znamenáček  wrote:

> I should have mentioned that Finder behaves unlike other apps in this
> regard. If I do the same with any other app, the app is correctly focused,
> stealing focus from whatever app was focused before. (And the menu bar on
> the display “gets focus”, too. Gets opaque, anyway.)

In the Finder, the desktop can be the main/key window.  For example, you can 
cycle to it using Command-`.

Regards,
Ken


___

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

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

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

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

Finder Sync extension menu limitations

2015-04-08 Thread Dragan Milić
Hello,

I wonder if anyone have got more experience developing Finder Sync extensions 
for Yosemite. I believe I figured out some things I’d like to achieve aren’t 
possible and I’d like to confirm them. It’s related to FIFinderSync protocol 
method - [FIFinderSync menuForMenuKind:]. According to documentation, in this 
method I’m supposed to create a menu containing menu items, which are related 
to selected and/or target items in one of monitored directories. That menu 
(that is, its items) will be added to Finder standard contextual menu (provided 
that FIMenuKind parameter is FIMenuKindContextualMenuForItems).

This all works fine, but I’ve noticed that not exactly menu items I created in 
above mentioned method are added to contextual menu, but their “shallow" 
copies. I say “shallow”, because, as far as I can see, only three properties of 
original menu items are used: title, image and action. All other properties I 
set to menu items in the protocol method aren’t used, including target, 
indentation, tag, represented object, etc. Therefore, “shallow" menu items that 
appear in Finder contextual menu have their targets set to nil, which means all 
menu item actions have to be implemented by the FIFinderSync subclass. This, as 
well as impossibility to pass menu items tags and represented objects, disturbs 
my code organisation a bit, but I can work around it.

But one particular things really bothers me; if I create a menu item which has 
its own submenu, the “shallow” menu item added to the contextual menu does not 
include that submenu, effectively preventing one from creating hierarchical 
menus provided by Finder Sync extension. My extension is supposed to provide 
quite some number of actions (depending on selection), many of them are 
logically grouped and not being able to organise them in hierarchical menu 
really clutters the whole Finder contextual menu with too many items.

Another interesting thing is that if in the action method of a certain 
“shallow” menu item I try to get a reference to its containing menu 
(practically trying to get reference to Finder contextual menu), that property 
returns nil, like the item doesn’t belong in to any menu at all.

If anyone realises I’m doing anything wrong, or knows how to overcome these 
limitations, I’d be really thankful for eventual insights.

-- Dragan
___

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

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

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

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

UITextView doesn't change the text in iOS 8.2(12D508)

2015-04-08 Thread wesley.dias wesley.dias
Hi,

I'm having trouble to change the text in a UITextView element on a iPhone
5 OS 8.2(12D508). The same layout works in other versions( version < 8 ).
I've tried to exclude and add the element again but it still doesn't work.

Suggestions?

Thank you all,

-- 

Atenciosamente,

Wesley C. Dias de Oliveira

Desenvolvimento

+55 (31) 3324-5710

Avenida Luiz Paulo Franco, 603 – 3º andar – Belvedere – BH – MG – CEP:
30320-570

Transformando localização em soluções inteligentes
___

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

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

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

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

Implement multi-tabs with WebView

2015-04-08 Thread Juanjo Conti
Hi! I'd like to use a WebView instance to handle a multi-tabs browser-like
desktop app. Is it possible using only one WebView instance? Or should I
need to use once per tab?

Thanks

-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

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

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

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

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

Re: Finder not responding to [NSRunningApplication activateWithOptions]

2015-04-08 Thread John Joyce

> On Apr 8, 2015, at 11:38 PM, Ken Thomases  > wrote:
> 
> On Apr 8, 2015, at 9:19 AM, Tomáš Znamenáček  > wrote:
> 
>> I should have mentioned that Finder behaves unlike other apps in this
>> regard. If I do the same with any other app, the app is correctly focused,
>> stealing focus from whatever app was focused before. (And the menu bar on
>> the display “gets focus”, too. Gets opaque, anyway.)
> 
> In the Finder, the desktop can be the main/key window.  For example, you can 
> cycle to it using Command-`.
> 
> Regards,
> Ken
> 
I NEVER noticed that before.
It’s weird because it IS a window, but it doesn’t order above others, so it 
isn’t totally obvious that the desktop has focus, and because its window level 
is so low, if you have multiple windows from other apps open, it’s extra not 
obvious.

Wow. This is a nice trick to know, but mostly not useful if you cannot see what 
you are selecting with the keyboard. Kind of scary actually to now realize this 
behaves this way. (it certainly explains curiously named items on my desktop 
over the years, and I have  weird feeling it’s been like this for forever and a 
day…)

So sounds like the trick is the window ordering, but that’s hard to tell with 
the desktop.

As a workaround though
[[NSWorkspace sharedWorkspace] launchApplication:@"Finder.app"];

Seems to do what Tomas is asking for.
Even selecting desktop first, the launching an app with this as the only thing 
in applicationDidFinishLaunching: brings Finder to the front with the front 
most (non desktop) window selected.

___

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

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

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

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

Re: Implement multi-tabs with WebView

2015-04-08 Thread Jens Alfke

> On Apr 8, 2015, at 1:24 PM, Juanjo Conti  wrote:
> 
> Hi! I'd like to use a WebView instance to handle a multi-tabs browser-like
> desktop app. Is it possible using only one WebView instance? Or should I
> need to use once per tab?

You’ll need one per tab.
You’ll also want to join the webkit-sdk-dev list on this site, which is the 
best place to get help with the WebKit APIs.

—Jens
___

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

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

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

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