Need some NSComboBox debugging help

2016-08-04 Thread livinginlosangeles
I have 8 NSComboBoxes in my application organzied into 4 pairs, each pair 
sharing an NSComboBox delegate. I have had some users periodically say that the 
combo-boxes get confused. ComboBox A will wrongly display ComboBox B’s data. I 
have scoured my code for an places where I might perform an assignment as 
opposed to performing an equality comparison. I have a hard recreating this 
event. More often than not, I experience my combo boxes not working. I’ll 
restart and everything will be fine. Not be able to repeat the issue is the 
biggest problem.  

My next step to solve this issue will be to catch the popupwillopen 
notifications so I can re-set the delegate.

Does anyone have any ideas on how to solve this issue?

Patrick
___

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

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

2016-07-23 Thread livinginlosangeles
Ok. That makes so much sense. This was a succinct explanation.

On Jul 23, 2016, at 8:40 PM, Ken Thomases  wrote:

> On Jul 23, 2016, at 10:12 PM, livinginlosange...@mac.com wrote:
>> 
>> I have a simple AppDelegate that instantiates an NSWindowController and 
>> Window. I have an NSMenuItem that invokes an IBAction on the firstResponder 
>> in my xib. This works as expected. When I press command+1, the IBAction 
>> fires. However, I specified that my NSWindowController use the 
>> ‘NSUserInterfaceValidations’ protocol, but my ‘validateUserInterfaceItem’ is 
>> never invoked. Any ideas why?
> 
> Is the class that implements validateUserInterfaceItem the same class that 
> implements the action method?  The frameworks only ask the target that will 
> be sent the action method to validate it.
> 
> Also, if your superclass implements validateMenuItem, then you need to 
> override that.  For actions that your class handles, you can implement it by 
> calling validateUserInterfaceItem if you want to cover all your bases (like 
> toolbar items).  For any other action, return what super returns.  The reason 
> is that NSMenu checks whether the target implements validateMenuItem before 
> it checks if it implements validateUserInterfaceItem.  If it implements the 
> former, it is called and the latter is not.
> 
> Unfortunately, whether a class implements validateMenuItem is not necessarily 
> documented.
> 
> 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

validateUserInterfaceItem not called

2016-07-23 Thread livinginlosangeles
I have a simple AppDelegate that instantiates an NSWindowController and Window. 
I have an NSMenuItem that invokes an IBAction on the firstResponder in my xib. 
This works as expected. When I press command+1, the IBAction fires. However, I 
specified that my NSWindowController use the ‘NSUserInterfaceValidations’ 
protocol, but my ‘validateUserInterfaceItem’ is never invoked. Any ideas why?

Thanks,

Patrick
___

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

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

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

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

Re: NSDocument not displaying save prompt on dirty document

2016-06-04 Thread livinginlosangeles
Ok. The issue was that the auto-save prompt had disappeared when I was closing 
a dirty nsdocument. I added a nswindowcontroller to my nsdocument using 
addWindowController. I needed to add setShouldCloseDocument to my main 
nswindowcontroller, otherwise my document wouldn’t show the prompt.

Patrick  
___

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

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

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

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

Re: NSDocument not displaying save prompt on dirty document

2016-05-29 Thread livinginlosangeles
Ok. The issue was that the auto-save prompt had disappeared when I was closing 
a dirty nsdocument. I added a nswindowcontroller to my nsdocument using 
addWindowController. I needed to add setShouldCloseDocument to my main 
nswindowcontroller, otherwise my document wouldn’t show the prompt.

Patrick  
___

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

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

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

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

Re: NSDocument not displaying save prompt on dirty document

2016-05-24 Thread livinginlosangeles
I never knew that was an option. I turned it on. Restarted my application, but 
still no prompt to save my dirty NSDocument when I close it. Any further ideas?

On May 24, 2016, at 12:29 AM, Graham Cox  wrote:

> 
>> On 24 May 2016, at 3:52 PM, livinginlosange...@mac.com wrote:
>> 
>> I have an NSDocument subclass that is no longer displaying a save prompt 
>> when I close a dirty document using the close: IBAction. My document is 
>> marked as dirty and I am using the NSDocument’s NSUndoManager. I am not 
>> doing anything behind the document’s back by setting the update count, etc. 
>> Would anyone have an explanation as to why my prompt has disappeared?
> 
> 
> Have you checked “Ask to keep changes when closing documents” in System 
> Preferences/General?
> 
> —Graham
> 
> 


___

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

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

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

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

NSDocument not displaying save prompt on dirty document

2016-05-23 Thread livinginlosangeles
I have an NSDocument subclass that is no longer displaying a save prompt when I 
close a dirty document using the close: IBAction. My document is marked as 
dirty and I am using the NSDocument’s NSUndoManager. I am not doing anything 
behind the document’s back by setting the update count, etc. Would anyone have 
an explanation as to why my prompt has disappeared?

Thanks,

Patrick
___

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

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

Debugging Faux Delegate calls

2015-10-19 Thread livinginlosangeles
I have 4 NSComboBoxes in a view.  I have a controller class which acts as the 
delegate for these ComboBoxes. For some reason, after a period of time, and I 
am trying to figure out why this is happening, when I enter ComboBoxA, my 
delegate is invoked, but when I query the ComboBox making the call, it is 
different from the box I am in. These ComboBoxes are IBOutlets to ComboBox’s in 
my nib/xib.

Any ideas on how best to debug this? I have no setters for ComboBoxes so I am 
not inadvertently changing them in the background.

Thanks,

Patrick
___

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

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

NSSavePanel?

2014-03-06 Thread livinginlosangeles
What’s Adobe’s beef with NSSavePanel? I found this while running fs_usage on my 
computer.

Adobe Easter Egg?

11:14:46  getattrlist   /Volumes/DriveA/030514   0.14   Adobe Photos
11:14:46  getattrlist   es/DriveA/030514/TestSave0.10   Adobe Photos
11:14:46  lstat64   __NSSAVEPANEL_IS_SO_L.AME0.07   Adobe Photos
11:14:46  lstat64   es/DriveA/030514/TestSave0.11   Adobe Photos
11:14:46  getattrlist   es/DriveA/030514/TestSave0.07   Adobe Photos
11:14:46  lstat64   __NSSAVEPANEL_IS_SO_L.AME0.06   Adobe Photos
11:14:46  getattrlist   __NSSAVEPANEL_IS_SO_L.AME0.04   Adobe Photos
11:14:46  write  0.24   screensharin
11:14:46  select 0.250128 W netsession_m
11:14:46  getattrlist   es/DriveA/030514/TestSave0.15   Adobe Photos
11:14:46  getattrlist   es/DriveA/030514/TestSave0.06   Adobe Photos
11:14:46  getattrlist   /Volumes/DriveA/030514   0.07   Adobe Photos
11:14:46  getattrlist   es/DriveA/030514/TestSave0.06   Adobe Photos
11:14:46  getattrlist   es/DriveA/030514/TestSave0.05   Adobe Photos
11:14:46  write  0.17   screensharin
11:14:46  getattrlist   TESTSAVE_2.psd   0.13   Adobe Photos
___

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

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

Minimizing NSTableView redraws

2013-10-31 Thread livinginlosangeles
I have an NSTableView with as many as 40 rows and 12 columns. Each row in my 
tableview represents one of my model objects. I use a detail view to edit 
objects that are displayed in the tableview. I have an NSTextView that is set 
to continuously update when a user modifies the NSAttributed string of my model 
object.

As my list of rows grows, text entry in my NSTextView crawls to a slow. I have 
profiled my code and it appears that set to continuously update marks the 
whole table view for update. On every keypress, the whole entire NSTableView is 
redrawn.

Is there any strategy to minimize this full redraw?

Patrick
___

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

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

ARC vs Manual Reference Counting

2013-09-08 Thread livinginlosangeles
Would anyone agree me that ARC introduces more rules and considerations than 
previously existed with manual reference counting?


On Sep 8, 2013, at 12:00 PM, cocoa-dev-requ...@lists.apple.com wrote:

 Send Cocoa-dev mailing list submissions to
   cocoa-dev@lists.apple.com
 
 To subscribe or unsubscribe via the World Wide Web, visit
   https://lists.apple.com/mailman/listinfo/cocoa-dev
 or, via email, send a message with subject or body 'help' to
   cocoa-dev-requ...@lists.apple.com
 
 You can reach the person managing the list at
   cocoa-dev-ow...@lists.apple.com
 
 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Cocoa-dev digest...
 
 
 Today's Topics:
 
   1. Evil setFrame: (Gerriet M. Denkmann)
   2. Re: Evil setFrame: (Kyle Sluder)
 
 
 --
 
 Message: 1
 Date: Sun, 08 Sep 2013 11:36:08 +0700
 From: Gerriet M. Denkmann gerr...@mdenkmann.de
 To: cocoa-dev@lists.apple.com
 Subject: Evil setFrame:
 Message-ID: 93387169-15d1-42a9-a1c0-fc516ffeb...@mdenkmann.de
 Content-Type: text/plain; charset=utf-8
 
 I try to show a nib (which uses autolayout and which contains among other 
 things a NewView inside an NSClipView inside an NSScrollView ) like this:
 
 if ( self.neuWindowController == nil )
 {
   //  NewWindowController is subclass of NSWindowController
   self.neuWindowController  = [ [NewWindowController alloc]   
 initWithWindowNibName:  @SomeNib 
   
 eventsList:   
   someArray 
   ];
 };
 
 [ self.neuWindowController showWindow: nil ];
 
 The last line triggers in my NewView:
 
 -[NewView resizeWithOldSuperviewSize:] NewView 0x101982430 bounds {{0, 0}, 
 {437, 252}}
 -[NewView resizeWithOldSuperviewSize:] NewView 0x101982430 frame  {{0, 0}, 
 {437, 252}}
 -[NewView resizeWithOldSuperviewSize:] NSClipView 0x10197b8e0 bounds {{0, 0}, 
 {398, 94}}
 -[NewView resizeWithOldSuperviewSize:] will call super with oldBoundsSize 
 {437, 254}
   -[NewView setFrame:] will {{0, 0}, {0, 0}}  ← why is super doing 
 this to me ??
 -[NewView resizeWithOldSuperviewSize:] got frame {{0, 0}, {0, 0}}
 
 and from here on nothing works (not too surprising with such a small frame).
 
 Something must be terrible wrong in my setup of NewView, but what?
 
 Gerriet.
 
 
 
 
 --
 
 Message: 2
 Date: Sat, 07 Sep 2013 22:04:31 -0700
 From: Kyle Sluder k...@ksluder.com
 To: Gerriet M. Denkmann gerr...@mdenkmann.de,
   cocoa-dev@lists.apple.com
 Subject: Re: Evil setFrame:
 Message-ID:
   1378616671.3574.19245285.59d48...@webmail.messagingengine.com
 Content-Type: text/plain; charset=utf-8
 
 On Sat, Sep 7, 2013, at 09:36 PM, Gerriet M. Denkmann wrote:
 I try to show a nib (which uses autolayout and which contains among other
 things a NewView inside an NSClipView inside an NSScrollView ) like this:
 
 if ( self.neuWindowController == nil )  
 {
  //  NewWindowController is subclass of NSWindowController
  self.neuWindowController  = [ [NewWindowController alloc]   
 initWithWindowNibName:  @SomeNib 
  
 eventsList:  
someArray 
  ];
 };
 
 [ self.neuWindowController showWindow: nil ];
 
 The last line triggers in my NewView:
 
 -[NewView resizeWithOldSuperviewSize:] NewView 0x101982430 bounds {{0,
 0}, {437, 252}}
 -[NewView resizeWithOldSuperviewSize:] NewView 0x101982430 frame  {{0,
 0}, {437, 252}}
 -[NewView resizeWithOldSuperviewSize:] NSClipView 0x10197b8e0 bounds {{0,
 0}, {398, 94}}
 -[NewView resizeWithOldSuperviewSize:] will call super with oldBoundsSize
 {437, 254}
  -[NewView setFrame:] will {{0, 0}, {0, 0}}  ← why is super doing 
 this to me ??
 -[NewView resizeWithOldSuperviewSize:] got frame {{0, 0}, {0, 0}}
 
 and from here on nothing works (not too surprising with such a small
 frame).
 
 Something must be terrible wrong in my setup of NewView, but what?
 
 NewView lacks sufficient constraints to specify its size or position, to
 it is being resized to zero.
 
 I'm guessing NewView is the direct subview of the clip view? If so, you
 _MUST NOT_ change its translatesAutoresizingMaskIntoConstraints
 property, and you _MUST NOT_ try to control its size or position with
 constraints.
 
 I learned that the hard way over the course of several months. It's
 quite a pain in the ass, because a lot of constraints you'll naturally
 want to draw will be just as likely to affect the size of the scroll
 view's documentView as they are to use the size of the documentView to
 affect the subviews.
 
 In our case, we 

CALayer autoresizing difficulties

2013-07-30 Thread livinginlosangeles
I am adding a special CALayer to the layer of my NSView. I can create my 
special CALayer, configure it, and add it the center of my NSView layer's 
heir-achy perfectly fine. However, as soon as I resize my main view, the 
special CALayer's bounds change. I specified the following autoresizing mask 
for my centered layer:



_playLayer = [PlayerButtons genericPlayButton];

[_playLayer setAutoresizingMask:kCALayerMinXMargin | kCALayerMaxXMargin | 
kCALayerMinYMargin | kCALayerMaxYMargin];

[_playLayer setPosition:CGPointMake(CGRectGetMidX([[self layer] frame]), 

CGRectGetMidY([[self layer] 
frame]))]; 

According to this code, the CALayer should be centered, and as the NSView's 
bounds change, the CALayer's frame should adjust to stay centered in the view 
while the layer's bounds don't change. However, my special CALayer's bounds 
grow as I expand my main view.



Patrick


___

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

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

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

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

Can I determine who is calling a delegate

2013-04-26 Thread livinginlosangeles
I have an object that is an NSComboBox delegate. For some reason, when I 
perform an editing operation in an unrelated tableView (inserting a new object 
and editing it in the field editor), any new text insertion I perform in one of 
3 NSComboBoxes ends up calling my delegate object twice. Is there a way for me 
to find out what object is posting a  -[NSNotificationCenter 
postNotificationName:object:userInfo:] that eventually calls my NSComboBox 
delegate?

Patrick

ps I have included a backtrace of the events prior to my delegate being called.


* thread #1: tid = 0x2303, 0x000537b6 ADR ToolBox`-[UIController 
comboBox:indexOfItemWithStringValue:](self=0x05ba4a00, _cmd=0x9562344a, 
aComboBox=0x015b0320, aString=0x0b576500) + 38 at UIController.m:2218, stop 
reason = breakpoint 1.1
frame #0: 0x000537b6 Application`-[UIController 
comboBox:indexOfItemWithStringValue:](self=0x05ba4a00, _cmd=0x9562344a, 
aComboBox=0x015b0320, aString=0x0b576500) + 38 at UIController.m:2218
frame #1: 0x95017e3b AppKit`-[NSComboBox(NSComboBoxCellDataSource) 
comboBoxCell:indexOfItemWithStringValue:] + 88
frame #2: 0x9501877a AppKit`-[NSComboBoxCell 
synchronizeTableViewSelectionWithStringValue:] + 97
frame #3: 0x9501885d AppKit`-[NSComboBoxCell 
synchronizeTableViewSelectionWithText:] + 79
frame #4: 0x95018e12 AppKit`-[NSComboBoxCell _complete:] + 122
frame #5: 0x9b798df1 Foundation`__-[NSNotificationCenter 
addObserver:selector:name:object:]_block_invoke_1 + 49
frame #6: 0x93145903 CoreFoundation`___CFXNotificationPost_block_invoke_1 + 
275
frame #7: 0x93110688 CoreFoundation`_CFXNotificationPost + 2776
frame #8: 0x9b783fde Foundation`-[NSNotificationCenter 
postNotificationName:object:userInfo:] + 92
frame #9: 0x9533fabf AppKit`-[NSTextView(NSSharing) didChangeText] + 357
frame #10: 0x95308a36 AppKit`-[NSTextView insertText:replacementRange:] + 
2218
frame #11: 0x954ea903 AppKit`-[NSTextInputContext 
insertText:replacementRange:] + 430
frame #12: 0x954e7fdd AppKit`-[NSTextInputContext handleTSMEvent:] + 2654
frame #13: 0x954e72aa AppKit`_NSTSMEventHandler + 214
frame #14: 0x920ddc0c 
HIToolbox`_InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, 
void*, long (*)(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)) + 36
frame #15: 0x91f59313 HIToolbox`DispatchEventToHandlers(EventTargetRec*, 
OpaqueEventRef*, HandlerCallRec*) + 1602
frame #16: 0x91f58790 
HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, 
OpaqueEventTargetRef*, HandlerCallRec*) + 482
frame #17: 0x91f6d571 HIToolbox`SendEventToEventTarget + 76
frame #18: 0x921e166e HIToolbox`SendTSMEvent + 74
frame #19: 0x921e1f69 HIToolbox`SendUnicodeTextAEToUnicodeDoc + 753
frame #20: 0x921e0e86 HIToolbox`TSMKeyEvent + 1007
frame #21: 0x91f82061 HIToolbox`TSMProcessRawKeyEvent + 2795
frame #22: 0x954eb15a AppKit`-[NSTextInputContext handleEvent:] + 1257
frame #23: 0x9538e57e AppKit`-[NSView interpretKeyEvents:] + 220
frame #24: 0x952fb64a AppKit`-[NSTextView keyDown:] + 676
frame #25: 0x94d55aeb AppKit`-[NSWindow sendEvent:] + 10891
frame #26: 0x94cedf77 AppKit`-[NSApplication sendEvent:] + 4788
frame #27: 0x000a73b0 Application`-[PCShuttleWindow 
sendEvent:](self=0x05178f50, _cmd=0x956cfa08, anEvent=0x0b5621b0) + 80 at 
PCShuttleWindow.m:6
frame #28: 0x94c7fb21 AppKit`-[NSApplication run] + 1007
frame #29: 0x94f10ac5 AppKit`NSApplicationMain + 1054
frame #30: 0x0003a7c4 Application`main(argc=3, argv=0xb7ec) + 36 at 
main.m:13
frame #31: 0x2cb5 Application`start + 53
___

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

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


NSComboBox and Multiple Selection

2013-02-12 Thread livinginlosangeles
I have an NSCombox bound to an NSArrayController's name attribute. If I 
choose multiple items and click on the pop up button in the NSComboxBox, the 
NSComboBox clears the name value for all of the different items' name 
attribute. This is less than ideal. I don't necessarily wish for the the value 
to be cleared when I click on the pop up button. The NSComboBox does not do 
this if I select items that share the same name attribute. In that case, the 
NSComboBox selects the name in the pop up window. What I would prefer is that 
the NSComboBox exhibit the same behavior as when I tab into the control when I 
have multiple values selected. Does any one have an idea?

Thanks,

Patrick
___

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

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


Warning users when editing multiple items

2013-02-05 Thread livinginlosangeles
I am revisiting an issue with which I had a problem earlier. I have a 
detail view which is bound to my model in an NSArrayController. Currently, I 
can edit multiple selections. What I want to accomplish is warn my users when 
they are about to edit multiple items and give them the choice of whether or 
not to do it. 
Now users can edit an item 2 ways. They can tab into the control (in 
this case an NSTextField or an NSComboBox) or mouseDown: into the control. I 
want to basically interpose both ways of accessing a control. The minute they 
try to click into a control, I want to perform logoc to determine multiple 
selection and then thrown an NSRunAlert… that they are about to edit multiple 
items.
Does anyone know of a good way to do this?

Thanks,
Patrick
___

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

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

2013-02-03 Thread livinginlosangeles

Ok, I just checked my code and I found exactly that. I had a conditional 
statement that wasn't balanced with a [NSGraphicsContext restoreGraphicsState]. 
I should of immediately thought of that as too many things were not operating 
correctly. The biggest problem was that I didn't see these errors on my 
machine. I only saw them on other machines. The scroll bar errors only appeared 
on certain OSes like 10.6 and 10.8, but not on 10.7.

Thanks for everyone's input.  

On Feb 02, 2013, at 09:58 PM, Kyle Sluder k...@ksluder.com wrote:

Unbalanced +[NSGraphicsContext saveGraphicsState] in your custom view's 
-drawRect? (Or in one of its subviews'?)

--Kyle Sluder

On Feb 2, 2013, at 9:19 PM, Patrick Cusack livinginlosange...@mac.com wrote:


You can see an example of the problem here:

http://i45.tinypic.com/fu8bpz.png

On Feb 2, 2013, at 8:06 PM, Graham Cox wrote:



On 03/02/2013, at 1:59 PM, Patrick Cusack livinginlosange...@mac.com wrote:


Sorry, I have asked this before, but I am genuinely perplexed and need help. I 
have an NSScrollView enclosing a custom view. When, I launch my application, I 
see the scroll bars of my NSScrollView being echoed or duplicated in the middle 
of my custom view. It is so annoying. I have tried everything I can to figure 
out why it is doing it. Has anyone ever seen this? I have been slowly pulling 
things out of my model, but the only thing that keeps it from happening, is if 
I completely hide the scrollbars, but then I need to add logic to scroll the 
view inside the scrollview.



Well, I've never seen this happen despite using NSScrollView extensively.

So that suggests that there is something a bit strange with the way you're 
creating it, or setting it up.


In IB, you can either add a scroll view than add a custom view to it, or add a 
custom view and then use 'Embed in Scrollview' to wrap it in the scrollview. 
Both work fine for me.

The next thing to check is the sizing settings. Are you using classic springs 
and struts or the newer constraints? I'm afraid I don't yet have any experience 
with the new thing, only springs and struts. The scroller should usually be set 
to expand and stick to all four sides of its enclosing view, but the custom 
view within is usually of a fixed size, and this might change programmatically 
according to your content. There's no reason to change any other setting, such 
as the scrollbars or the clip view of the scrollview.

Whether your custom view is flipped or not will affect the way the scrollview 
behaves - something to check.

Does anything in your code fiddle with the scrollview? There is rarely a need 
to. Have you subclassed it, and overridden something like -tile?

You could try starting a fresh project and quickly trying to put together a 
simple scrollview without any special code and verify it works, then look for 
what difference there is in your project that changes that.


--Graham


___

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

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

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

This email sent to k...@ksluder.com

___

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

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

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

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

Weird Scrollbar behavior

2013-01-29 Thread livinginlosangeles
Has anyone every seen this kind of weird scroll bar behavior? I embedded a 
custom view in an NSScrollView. The scroll bars do not appear to be drawing 
correctly, and they also appear in the middle of my custom view. This happens 
on 10.6, yet not when I build on 10.7.  I also see it on 10.8. I have tried 
fixing this by building in XCode 3.2 as well as XCode 4.3.

http://i45.tinypic.com/fu8bpz.png


Patrick
___

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

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


Editing multiple selections with bindings

2013-01-01 Thread livinginlosangeles
I have an application where a user can select multiple rows of data from an 
NSArrayController and edit those rows from a detail view. Now, there are cases 
where users have inadvertently changed the values for multiple rows of data 
when they did not intend to. How can I warn a user when they enter a texfield 
or nscombobox that they are about to edit multiple rows of data and gracefully 
give them a way to back out? I noticed that there is no way to discard editing 
when in a textfield. Is that the case? I am using the control: 
textShouldEndEditing: delegate method which allow me to get 90% of the way 
there, but the textfield retains focus, and I can not tab out of the field 
without getting my warning. Ideally, pressing esc should allow me to discard 
any editing and make the field lose focus. 

Thoughts?

Thanks,
Patrick
___

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

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


Proper place to post on 10.8 SDK?

2012-06-11 Thread livinginlosangeles
Where could I post questions regarding the 10.8 SDK? Is that on the apple 
developer website?

Patrick
___

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

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


NSText showGuessPanel: problem

2011-12-31 Thread livinginlosangeles
If I invoke a menu for an NSTextView, I can successfully spell check the text 
in my NSTextView by choosing Spelling and Grammar-Show Spelling and Grammar. 
This menu item calls showGuessPanel: . The guessPanel is opened and it appears 
that the Guess Panel is synchronized with the misspelled words in my 
NSTextView. But if I set the attributed String value of an NSTextView and 
invoke Spelling and Grammar on the newly set NSTextView using showGuessPanel, 
it doesn't work the same.
[mySmallTextView  showGuessPanel:mySmallTextView];

When I do this, it appears that the newly opened panel selects the first word 
that is misspelled, but the spelling panel can not correct the misspelled word 
when I press change, nor does the Find Next button work in the panel. 

Why would the NSTextView's invocation of showGuessPanel: be different 
than a my invocation?


Patrick
___

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

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


NSScrollView Anomaly

2011-10-17 Thread livinginlosangeles
I have an NSwindow that contains an NSScrollView encapsulating a NSView. I 
experience weird behavior where the scrollbars appear white and only draw 
themselves when I resize the window. I have a picture of it here:

http://flic.kr/p/awJRcG

Any ideas of why this might be happening? It is really annoying.

Patrick
___

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

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


NSComboBoxCell AutoComplete

2011-10-09 Thread livinginlosangeles
I have an NSComboBox bound to the selection of an NSArrayController. The bound 
object is an NSDictionary.  I use an NSValueTransfomer to represent the 
NSDictionary. The ValueTransformer gives me the dictionary's summary property 
which is useful for people choosing the appropriate NSDictionary from the 
array. I have set up the NSComboBox to use a datasource for custom 
autocompletion. I need case insensitive autocompletion which does not come 
straight of the box. Whenever I star typing in my NSComboBox, I get an 
-[NSDictionary length] exception. The NSComboxCell is trying to complete by 
sending a length request to the bound object, not through the transformer. Is 
there a way around this? The calling method before the exception is 
[NSComboBoxCell _completeNoRecursion]. Thanks,

Patrick
___

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

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


NSUndoManager - unstable state

2011-06-29 Thread livinginlosangeles
Is there a way to check if the NSUndomanager is in an unstable state and reset 
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


Bindings Question

2010-09-24 Thread livinginlosangeles
I have variable in my NSDocument subclass that is bound to the following path 
_myNSArrayController.selection.subNSArrayController.selection.variableOfInterest.

When I change the subNSArrayController's selection, I don't always see my 
variable's setters getting called in my NSDocument subclass. WHY?? Its not like 
I'm a binding noob!  Ugh.


Patrick
___

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

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


NSPathStore2 HELP!!!!!!

2010-02-19 Thread livinginlosangeles
 
 Subject: Re: NSPathStore2 HELP!!
 
 Ok, here is how I solved this. Before I called [NSKeyedUnarchive 
 unarchive...], I called the class method:
 
 [NSKeyedUnarchiver setClass:[NSString class] forClassName:@NSPathStore2];
 
 This fixed the errors and allowed me to reclaim the data. NSPathStore2 can 
 not be initialized, so I just told the Unarchiver to treat it as a NSString 
 instead.
 
 
 On Feb 19, 2010, at 4:46 PM, Patrick Cusack wrote:
 
 I have serialized by an NSDictionary object using NSKeyedArchiver in my 
 document's save method. When I unarchive the data, I get a error 
 
 *** initialization method -initWithCharactersNoCopy:length:freeWhenDone: 
 cannot be sent to an abstract object of class NSPathStore2: Create a 
 concrete instance!
 
 
 This is killing me as I can't restore my data. Any thoughts?? Please help
 
 
 Patrick
 

___

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

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


updating NSView on separate thread

2010-01-31 Thread livinginlosangeles
I have overlaid a transparent window over my NSDocument's main window. My 
intent is to draw textual notifications to it, such as Processing..., 20 
things selected The idea is partially experimental, etc. I thought it 
would be neat to display a spinning icon in the a subclassed content view of 
the overlay window when the program is doing something lengthy like saving, 
exporting pdfs, etc. A created a new thread that would run for the duration of 
an operation. This thread would call drawrect which would draw my spinning 
icon.  I create the new thread before a length operation. I assume that the 
lengthy operation would occur on the main thread while the drawing operation 
happens on the secondary thread. Utlimately my drawrect method doesn't get 
called in the secondary thread. Am I going about this all wrong?

patrick
___

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

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

2009-07-24 Thread livinginlosangeles

I'll follow up on that tomorrow. Thanks,

Patrick


Hi,

I am using the following two methods for a scrolling number box which
is essentially a slider in the form of a NSTextField subclass.  I have
yet to implement this for my custom sliders but maybe this is a good
starting point for you?  When I first dabbled with custom sliders all
I did was override the mouseUp, mouseDown, mouseDragged methods etc
now my custom sliders are subclasses of NSControl rather than  
NSSlider.


-(void)mouseUp:(NSEvent*)theEvent
{
if(drag) drag = NO;
}

-(void)mouseDragged:(NSEvent*)theEvent
{
float val = [self floatValue];

if(!drag) {
// float start_x = [self convertPoint: [theEvent 
locationInWindow]
fromView: nil].x;
start_y = [self convertPoint:[theEvent locationInWindow] 
fromView:
nil].y;
prev_y = start_y;
drag = YES;
};

// key modifier key flags
unsigned int flags;
flags = [theEvent modifierFlags];

float next_y = [self convertPoint:[theEvent locationInWindow]
fromView: nil].y;
float deltaY = (next_y - prev_y) / dragSize;
prev_y = next_y;

if(flags  NSAlternateKeyMask) deltaY *= fineGrain;
val += range * deltaY;

[self checkBounds:val];
[self setFloatValue:val];

// continuously send the action
[self sendAction:(SEL)[self action] to:(id)[self target]];
}


___

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

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


NSSliderCell question

2009-07-23 Thread livinginlosangeles
I am employing an NSSliderCell in my table view, and I want to slow  
down the rate of change or increase the resolution of change using a  
modifier key like commands as I drag. This is employed in a few audio  
programs to assist a mixer in fine tuning either volume or pan when  
mixing. Where do I start? I have bound my NSSliderCell to a NSNumber  
in my NSObjectController. Can anyone think of a way that I could  
modify the delta of change? Would I have to do this using a  
NSSliderCell subclass? Any thoughts?


Patrick
___

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

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


Question re: [NSWindow setFrame:display:]

2009-04-06 Thread livinginlosangeles
In my NSDocument subclass, I am trying to set the main window's frame  
in the windowControllerDidLoadNib: method. For some reason, I can set  
the width and height of the window's frame, but not its origin. Any  
ideas? I am using the setFrame:NSMakeRect(x, y, w, h) display:YES


[[self windowForSheet] setFrame: NSMakeRect(0,0,100,100) 
display:YES];

LA
___

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

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


Archiving objects on seperate thread

2009-02-19 Thread livinginlosangeles
I have an NSDocument that has several NSArrayControllers worth of  
data as well as a bunch of iVars. I can succesfully archive my  
Document's iVars and my ArrayContollers' contents, and I can  
succesfully implement NSDocument's autosave feature. However, and  
this is a design limitation on my part, whenever I archive a  
substantial number of objects from my NSArrayControllers (around  
5000), my save operation can last upwards of 10 seconds (and there is  
another discussion to be had about that since I profiled it in  
Shark). This is unacceptable for autosaving as the UI becomes  
unresponsive. Now I can easily create an NSThread and run a save  
operation in the background to archive my data. But my question is  
this: what risks do I have in changing data to an object that is in  
the process of being saved?


Patrick
___

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

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


Repost Programmaric NSTextField not editable

2009-01-06 Thread livinginlosangeles
I want to display a programmatic list of NSTextfields in a view that  
is enclosed in a scrollview.


I have a tabview whose view contains a scrollview which contains my  
custom view that I wish to display NSTextFields on. I can create the  
text fields and bind them to my model, however, I can't edit them  
despite having set the Textfield's setEditable method.


Would anyone have an explanation of this?

Patrick

___

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

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