Popup button cells in a table view

2010-07-27 Thread Kiel Gillard
Hi all,

I have a table view with a column whose data cell is a NSPopupButtonCell. I am 
using one array controller to provide the table view rows and a seperate array 
controller to provide the popup button menu items.

My table column (as opposed to the cell) has its content bound to the arranged 
objects of the popup button array controller. The content values are bound to a 
"name" property of the arranged objects of the popup button array controller. 
The selected object of the table column is bound to the appropriate property of 
the table view array controller's arranged objects. I am using the null 
placeholder option in the content and content value bindings.

This is the same configuration as you'd expect to find in mmalc's ToDos 
bindings example code. The only difference is I am using the null placeholder 
option.

My problem is this. When I run my app, the popup button menus contain the 
descriptions of the arranged objects in the popup array controller instead of 
respecting the content value binding I have specified.

I am certain my model is key-value coding compliant for the content value 
binding's key path. I am also certain that I am not binding to the cell (as 
opposed to the table column). From what I can infer, it seems that using the 
null placeholder option is not the source of the problem.

Does anyone have any ideas what I am doing wrong? Why would the content value 
binding of the table column be ignored?

Thanks for your ideas and suggestions,

Kiel___

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

Please do not post admin requests or moderator comments to the list.
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: shouldAutorotateToInterfaceOrientation not being called ...

2010-07-27 Thread Matt Neuburg
On Mon, 26 Jul 2010 16:53:53 -0700, Jay Reynolds Freeman
 said:
>Sorry I did not make clear; that was an excellent idea; I made one, it worked,
and not only does the relevant code (just mentioned) look the same in my app,
but also the connections between top-level objects in the nib files look the
same. Go figure ...  I may well be missing something, of course.

Well, clearly you *are* missing something. There must be an important
difference between the project that works as expected and the one that
doesn't. This is parallel to what I was saying before about the outlets that
didn't result in the corresponding ivars being set. The response to things
not working is not to walk away from them but to try to understand what's
wrong. On the other hand, if the nib has mysteriously gone sour, then
there's nothing to understand. I've never seen a nib do this, but I've
certainly heard reports of it happening.

One good solution might be to start over. Start with the clean project where
the autorotate mechanism does work. Now start copying and pasting your code
and classes into it, moving your resources into it, etc. Keep testing at
every stage. If at some point the autorotate stops working, then whatever
you last did was the wrong thing to do. :) If it never stops working, fine,
the problem is solved.

Or, go the other way. Make a copy of your project and start cutting stuff
out of that project until it looks like the bare minimum project. If at some
point autorotate starts working, whatever you just removed was the cause of
the trouble. :)

m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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

Please do not post admin requests or moderator comments to the list.
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: Truncating UIActionSheet labels

2010-07-27 Thread Steve Christensen
Although you say that the button labels are generated dynamically, does it 
really not make sense for you to generate the alert title and/or message 
strings dynamically and use static button labels (OK/Cancel, Yes/No, etc.)? 
Both of those fields are set up to resize to fit the strings. Otherwise it 
seems like you're fighting against the design of UIActionSheet.


On Jul 27, 2010, at 4:07 PM, Fritz Anderson wrote:

> iOS 3.2 (iPad)
> 
> I want to present a UIActionSheet on an iPad. The label strings for the 
> choices are dynamically constructed. The strings may be wider than the 
> buttons, and tail truncation isn't good — the distinct parts are mostly at 
> the end.
> 
> Is there any way to get middle truncation into the labels in a UIActionSheet? 
> The obvious way is to truncate the strings myself before putting them into 
> the sheet, but it looks as though I'd have to do that myself, and I won't get 
> it right for the display width. The string-drawing category of NSString will 
> let you _measure_ or _draw_ a truncated string, but you can't get the 
> truncated string back. I suppose one could iterate trial truncations until I 
> find one that fits, but it seems inelegant.
> 
> A nice way to do it would be to set some sort of property in the sheet or its 
> buttons, in the willPresentActionSheet: delegate method if necessary. There 
> seems to be no hook for that, other than iterating the sheet's subviews for 
> UIButtons and setting the truncationMode of the respective labels. This 
> doesn't sound like a winning bet for future compatibility.
> 
> Ideas, please?

___

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

Please do not post admin requests or moderator comments to the list.
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


Truncating UIActionSheet labels

2010-07-27 Thread Fritz Anderson
iOS 3.2 (iPad)

I want to present a UIActionSheet on an iPad. The label strings for the choices 
are dynamically constructed. The strings may be wider than the buttons, and 
tail truncation isn't good — the distinct parts are mostly at the end.

Is there any way to get middle truncation into the labels in a UIActionSheet? 
The obvious way is to truncate the strings myself before putting them into the 
sheet, but it looks as though I'd have to do that myself, and I won't get it 
right for the display width. The string-drawing category of NSString will let 
you _measure_ or _draw_ a truncated string, but you can't get the truncated 
string back. I suppose one could iterate trial truncations until I find one 
that fits, but it seems inelegant.

A nice way to do it would be to set some sort of property in the sheet or its 
buttons, in the willPresentActionSheet: delegate method if necessary. There 
seems to be no hook for that, other than iterating the sheet's subviews for 
UIButtons and setting the truncationMode of the respective labels. This doesn't 
sound like a winning bet for future compatibility.

Ideas, please?

— F

___

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

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

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

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


Re: Modal phone calls?

2010-07-27 Thread Luke the Hiesterman

On Jul 27, 2010, at 3:18 PM, Martin Stoufer wrote:

> 
> I have a working app that is using the openURL: method on its 
> sharedApplication to dial a phone#. The issue I am unable to resolve now is 
> how to get the phone app to 'background' itself once the call is over and 
> bring back my app to the foreground. I am reading up on many possible avenues 
> in the docs that seem plausible but are rather protracted and mind-bending.
> 
> So for starters, can this be done given iOS4?
> 

No. Only the user can choose to background/exit the foreground application.

Luke

___

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

Please do not post admin requests or moderator comments to the list.
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


Modal phone calls?

2010-07-27 Thread Martin Stoufer
 I have a working app that is using the openURL: method on its 
sharedApplication to dial a phone#. The issue I am unable to resolve now 
is how to get the phone app to 'background' itself once the call is over 
and bring back my app to the foreground. I am reading up on many 
possible avenues in the docs that seem plausible but are rather 
protracted and mind-bending.


So for starters, can this be done given iOS4?

--
* Martin C. Stoufer  *
* ISS/IT *
* Lawrence Berkeley National Lab *
* 510-486-5306   *
* MS 69-211  *

___

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

Please do not post admin requests or moderator comments to the list.
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


Test Applications under 10.4 without rebooting?

2010-07-27 Thread Mr . Gecko
Hello, I'm wondering if there would be a way to test my applications under 10.4 
without rebooting. I own 4 copies of 10.4 and I have 10.4 on a partition to 
boot into and test my software, but I'll rather not have to reboot to test my 
applications as rebooting is a pain. I thought of a few things such as running 
my install dvd on VirtualBox, which didn't work. Leopard works on it and I 
think they don't allow Tiger because the user license for it doesn't allow 
virtualization which I would think I would be able to do it on my Mac. I also 
thought about chroot in terminal to make the root the tiger partition and then 
run the application from there to make it use Tiger's APIs and such, but it 
seems to not do anything when I run it. This is the command I ran "sudo chroot 
/Volumes/Tiger /Toolbar.app/Contents/MacOS/Toolbar" I did have the application 
in the tiger partition at that location if that maters. Anyone have a solution 
for testing this stuff under tiger? In the mean time I'll reboot to test this...

Thanks,
Mr. Gecko

smime.p7s
Description: S/MIME cryptographic signature
___

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

Please do not post admin requests or moderator comments to the list.
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: Elapsed time vs sleep

2010-07-27 Thread Fritz Anderson
On 27 Jul 2010, at 1:42 PM, Jeffrey Oleander wrote:

> Whatever happened to hardware monitoring and control
> of the CPU (core)?

They are there. In the kernel.

For user-space code, Darwin is not a real-time operating system. Period. Apple 
has been saying so for ten years or more.

I'm not an expert, but the how-hard-could-it-be you propose sounds... like most 
how-hard-could-it-bes. Ever watch Top Gear?

— F

___

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

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

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

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


-remoteControlReceivedWithEvent: is not getting called

2010-07-27 Thread Steve Christensen
I am trying to get remote control events to start/stop some audio my app is 
playing, but -remoteControlReceivedWithEvent: isn't getting called. My app has 
a tab bar that switches among multiple views, if that makes any difference.

The view controller for each view implements the setup per Apple's docs on 
using remote control events 
(https://developer.apple.com/iphone/library/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/RemoteControl/RemoteControl.html#//apple_ref/doc/uid/TP40009541-CH7-SW1).
 I've copied those bits below for reference.

Any ideas on why -remoteControlReceivedWithEvent: isn't getting called? Should 
I be implementing it on another object in the responder chain?

steve


- (BOOL) canBecomeFirstResponder
{
return YES;
}


- (void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
}


- (void) viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[self resignFirstResponder];
}

___

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

Please do not post admin requests or moderator comments to the list.
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: Elapsed time vs sleep

2010-07-27 Thread Jeffrey Oleander
> On Mon, 2010/07/26, Kyle Sluder  wrote:
>> Charlie Dickman <3tothe...@comcast.net> wrote:
>> As long as the NSTimer firing interval is
>> sufficiently small the NSTimer can be used.
>> If the run loop is stalled for any "significant:
>> time _all_ timers will be inaccurate to some
>> degree.
>
> This is untrue. mach_absolute_time is the kernel's
> timekeeping mechanism. It is not susceptible to
> runloop stalling or any stalling for that matter,
> short of a hardware failure or a bug in the kernel.
>
> NSTimer can't fire at a rate beyond a certain threshold.
> On the main runloop, I believe this will wind up being
> somewhere around one thread quantum because the main
> runloop is responsible for fetching events...

Whatever happened to the pre-emptive processing we were
supposed to be getting with OS X?
If it were pre-emptive, you'd interrupt and then it
would happen, not twiddle around until the next time
around a run-loop and sifting through a queue.  
In this context, you'd set the timer, and when the 
time was up, control would switch to where you'd told 
it to when you set up the timer.
Boom.  Ditto with a user-interrupt.
Only if there were a conflict -- essentially two 
interrupts at once, within less than a millisecond 
of each other -- would any queueing, stacking, etc., 
come into play.

Whatever happened to hardware monitoring and control
of the CPU (core)?


  
___

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

Please do not post admin requests or moderator comments to the list.
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


MacTech Conference 2010: Registration Open

2010-07-27 Thread Edward Marczak
On June 8th, I sent a note to this list looking for speakers for
MacTech Conference. To follow up: the responses have been really
wonderful and the conference is open for registration.

You'll likely recognize many of the people presenting, and there are
many new-comers with great material. It's going to be an amazing three
days of learning and interacting with peers in the Macintosh
community.

Please send questions off-list directly to me at
exec-edi...@mactech.com. Thanks, and I hope to see everyone in
November at MacTech Conference.
-- 
Ed Marczak
MacTech Conference: http://www.mactech.com/conference
___

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

Please do not post admin requests or moderator comments to the list.
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


Creating of "Open with" menu like in Finder

2010-07-27 Thread Vera Tkachenko
Hello,

I want to build exactly the same menu as Finder's 'Open With' menu. Is there an 
easy way to do this instead of creating this menu manually using LaunchServices?

Thanks,
Vera Tkachenko___

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

Please do not post admin requests or moderator comments to the list.
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: tableview multiple selected loop

2010-07-27 Thread Amy Gibbs

Thanks,

realised I don't actually need to loop through, as I can just assign  
the whole set to the relationship:


[[kit mutableSetValueForKey:@"kitItem"] addObjectsFromArray:kitItems];

Thanks,

On 27 Jul 2010, at 2:05PM, Graham Cox wrote:



On 27/07/2010, at 5:53 PM, Amy Gibbs wrote:

If i've got multiple rows selected in a table view, and I want to  
do something with each of them, do I need some kind of loop in my  
code, or will cocoa automatically run the code for each selected  
row? I can't find any kind of while, foreach type of loop example  
anywhere?



The table's selection is expressed using an NSIndexSet object,  
retrieved using -selectedRowIndexes. You can use its methods such as  
-firstIndex, -nextIndexGreaterThan:, etc to iterate through the  
index values it contains, or use methods on other classes such as  
NSArray that take an NSIndexSet argument, like -objectsAtIndexes:


This latter is probably more common, since having got the subarray  
of objects of interest, you can enumerate those using NSEnumerator  
or fast enumeration, or just use the subarray as an argument  
elsewhere.


--Graham






___

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

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

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

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


Re: tableview multiple selected loop

2010-07-27 Thread Graham Cox

On 27/07/2010, at 5:53 PM, Amy Gibbs wrote:

> If i've got multiple rows selected in a table view, and I want to do 
> something with each of them, do I need some kind of loop in my code, or will 
> cocoa automatically run the code for each selected row? I can't find any kind 
> of while, foreach type of loop example anywhere?


The table's selection is expressed using an NSIndexSet object, retrieved using 
-selectedRowIndexes. You can use its methods such as -firstIndex, 
-nextIndexGreaterThan:, etc to iterate through the index values it contains, or 
use methods on other classes such as NSArray that take an NSIndexSet argument, 
like -objectsAtIndexes:

This latter is probably more common, since having got the subarray of objects 
of interest, you can enumerate those using NSEnumerator or fast enumeration, or 
just use the subarray as an argument elsewhere.

--Graham

 


___

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

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

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

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


Re: iPhone orientation problems

2010-07-27 Thread Eric Giguere
Hi Laurent

No apologies please, your input did guide me in the right direction.

The structure of my application was some kind of workaround of the problem 
where NavigationController cannot be loaded from a nib, at least not like the 
other type of controllers due to the fact that this guy creates its view 
dynamically. 
So instead of using a plain controller that has no "child" support, I took the 
UITabBarController, inserted my graphical view as its first item and configured 
the navigator with my custom controllers and guess what, gone the orientation 
problem.

The problem lies somewhere in the framework. I tested my application yesterday 
on iOS4 and again a surprise, the orientation shift is transmitted by only 
after the view finishes its apparition on screen.

Thank you both Matt and Laurent for your help.

Eric.



On 2010-07-26, at 17:05, Laurent Daudelin wrote:

> 
> 
> On Jul 26, 2010, at 13:33, Matt Neuburg wrote:
> 
>> On Mon, 26 Jul 2010 10:03:14 -0400, Eric Giguere 
>> said:
>>> Hi Matt
>>> 
>>> Thanks for the advice.
>>> 
>>> So, if I got it right, I have to remove the second controller from my main
>> window nib file and put it elsewhere. Otherwise, it gets created at the same
>> time as the other. I did that to go around a problem with the Navigation
>> Controller. This guy doesn't get loaded when you put it alone in a nib and 
>> then
>> initialize it by loading the nib file. Pretty strange...
>>> 
>>> So, with your suggestion, I should keep the navigator interface with the 
>>> main
>> xib and create / release the other view when needed.
>>> 
>>> Got you right?
>> 
>> I don't see why what you're describing has anything to do with what I said.
>> My advice was about the window's primary subview. If that's controlled by a
>> navigation controller in your app, then it is that navigation controller
>> that I'm suggesting you would need to worry about. m.
>> 
>>> On 2010-07-25, at 15:39, Matt Neuburg wrote:
>>> 
> Everywhere, it is said that it should be handled automatically when adding
>> the
 subview to the window but it doesn't seem to work, at least not with my
 controller layout.
 
 My experience is that you have to wait until the window's primary subview
 has itself rotated before you do any further interface configuration. I add
 code like this to my main subview's controller:
 
 - (void)didRotateFromInterfaceOrientation:
  (UIInterfaceOrientation)fromInterfaceOrientation {
  if (!didInitialSetup) { // once, at startup: set up interface
  didInitialSetup = YES;
  [self setUpInterface];
  }
 }
 
 That way I don't create the nested interface until the main view has 
 settled
 down into its initial rotation. Otherwise, if I do things too soon, x and y
 are reversed and everything is wonky after that. This trick has really
 helped me with autorotation, though I don't know if it will be useful in
 your case.
 
 m.
 
>> 
> 
> It's a little hard to see what the original poster's problem is, so maybe my 
> message is irrelevant, but as far as orientation is concerned, I don't think 
> having the controllers all in the same xib is the problem because I do it in 
> a couple of apps.
> 
> My latest app is a tab bar-based app. Each tab item brings a navigation-based 
> view which contains a UITableView. The key is to make sure you subclass all 
> the controllers in the view hierarchy, starting with the tab bar view 
> controller all the way down to the UITableViewController so that they can all 
> return YES to the shouldAutorotateToInterfaceOrientation:.
> 
> My MainWindow.xib file has the layout of the tab bar view with a custom 
> navigation controller for each tab bar item. Of course, each UITableView is 
> loaded from a different xib but it all works fine.
> 
> If I missed something, I apologize.
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://www.nemesys-soft.com/
> Logiciels Nemesys Software
> laur...@nemesys-soft.com

Eric Giguere
eric.gigu...@videotron.ca





smime.p7s
Description: S/MIME cryptographic signature
___

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

Please do not post admin requests or moderator comments to the list.
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: Knowing how a Text Editing Session ended

2010-07-27 Thread Motti Shneor
Thanks Keary, 

In the mean time I already done lot's of Googling and dug into the docs, but 
what I found was quite discouraging.

First, the FieldEditor is a preconfigured instance of NSTextView attached to 
the window. There's only one field-editor serving all the NSTextField's of the 
window. I'm writing a plug-in, so both the window and other text fields are NOT 
MINE --- meaning, I don't want to alter the behavior of the "system" field 
editor. I'd rather install my delegate on it when creating my specific 
NSTextField, and revert the delegate when the user leaves the text field.

Next --- Overriding NSTextView's "insertTab" "insertBackTab" "cancelOperation" 
and the like won't work, because they aren't being called to start with, if a 
modifier key (option, command, ctrl) is pressed. I went into the docs and found 
the following frightening info:


Here's an excerpt from the Text Editing Programming Guide / About Key Bindings:

The text input system uses a dictionary property list, called a key-bindings 
dictionary, to interpret keyboard events before passing them to the Input 
Method Kit framework for mapping to characters.

... processing a keyboard event ...  an NSResponder subclass can choose to 
process certain keys and ignore others (for example, in a game) or to send the 
handleEvent: message to its input context.

The input context checks the event to see if it matches any of the keystrokes 
in the user’s key-bindings dictionary. A key-bindings dictionary maps a 
keystroke (including its modifier keys) to a method name. For example, the 
default key-bindings dictionary maps ^d (Control-D) to the method name 
deleteForward:. 

If the keyboard event is in the dictionary, then the input context calls the 
text view’s doCommandBySelector: method with the selector associated with the 
dictionary entry.
If the input context cannot match the keyboard event to an entry in the 
key-bindings dictionary, it passes the event to the Input Method Kit for 
mapping to characters.

The standard key-bindings dictionary is in the 
file/System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict.
 
You can override the standard dictionary entirely by providing a dictionary 
file at the path~/Library/KeyBindings/DefaultKeyBinding.dict. 
However, defining custom key bindings dynamically (that is, while the 
application is running) is not supported.


I examined this file, and indeed --- "insertTab" "insertBackTab" 
"insertNewLine" and the likes are there. Which means --- I can't introduce my 
"insertUpTab" at runtime!!!

Or, at the very least, I need to override a very basic keyboard event-handling 
method of the Field editor (keyDown) which I don't like to do.

Any observations? 

I think I saw something about Forms (grouped text fields) that allow moving 
between fields using arrows (like in a spreadsheet) but I don't know how to set 
up a "Form" environment with no fields... or just one temporal text field...

Again, any hint will be appreciated.


On 22/07/2010, at 17:45, Keary Suska wrote:

> On Jul 22, 2010, at 2:47 AM, Motti Shneor wrote:
> 
>> Thanks Mike --- Following your recommendation and the docs,  I managed to 
>> extract the value of the @"NSTextMovement" key from the notification 
>> userInfo Dictionary, which contains just what I needed.
>> 
>> However, I found that my problem is a bit deeper  --- I want to finish the 
>> text editing session in 2 extra "nonstandard" ways (option-Tab, and 
>> option-shift-Tab) which in our specific context mean "Tab to the field below 
>> this field" and "Tab to the field above this field". the up and down 
>> equivalents to the Tab and BackTab.
>> 
>> Unfortunately, the FieldEditor does not end the editing session in reacion 
>> to these key-presses, and inserts the characters into the text instead.
>> 
>> My Question:  How can I Persuade the FieldEditor to end an Editing Session 
>> when these specific key-combinations occur? Should I override something? Is 
>> there a specific Delegate for that?
>> 
>> I thought that there should be something like:
>> 
>> - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText 
>> *)fieldEditor
>> 
>> Where my delegate could decide if the current input (last key pressed) 
>> should cause the FieldEditor to resign editing on this field, or not.
>> But this delegate is only called when Tab, BackTab, Esc or Enter/Return are 
>> pressed  so I don't have the chance to decide.
>> 
>> Any ideas?
>> 
>> How can I configure the FieldEditor? Any sample code known to anyone?
> 
> I would start with Googling around for modifying tab press behavior in an 
> NSTextView, and/or how to override tab press behavior for an NSTextField. I 
> believe Apple shows how to do the former in one of the standard docs. 
> Somewhere you 

Re: How to fastly get the active window's title?

2010-07-27 Thread Dave Keck
CGWindowListCreate() and CGWindowListCreateDescriptionFromArray() are
probably your best bet, with the accessibility APIs being another
option.

Note that that UI controls are sometimes implemented as separate
windows, but from the user's perspective they belong to a parent
window; this is something you'll likely need to consider when using
these APIs. For example, just because a window is at the beginning of
the window list returned from CGWindowListCreate(), doesn't mean it's
what the user would consider the "active window."
___

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

Please do not post admin requests or moderator comments to the list.
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


tableview multiple selected loop

2010-07-27 Thread Amy Gibbs

Hi,

If i've got multiple rows selected in a table view, and I want to do  
something with each of them, do I need some kind of loop in my code,  
or will cocoa automatically run the code for each selected row? I  
can't find any kind of while, foreach type of loop example anywhere?


Thanks

(Background:
I've got a table showing instances of a product entity. I want to link  
those to an instance of a kit entity. they are set up as a many to   
many relationship in the datamodel. The kit instance is selected in  
another table. I want to loop through all of the selected products,  
and add the relationship to the selected kit)

___

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

Please do not post admin requests or moderator comments to the list.
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