Re: Identifying a specific Mac model

2015-09-15 Thread John Daniel
Sure. The path to the new MacBook images is 
/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MJTlrL7BTqUr.bundle

However, it would be impossible for me to inspect this. Because I am using this 
system function, I could only see it go into this new bundle if I was running 
it on a new MacBook. It does seem to work, but my confidence is based more on 
faith than works.

John Daniel
i...@etresoft.com



> On Sep 15, 2015, at 4:16 PM, Marek Hrušovský  wrote:
> 
> Can you please tell us the path? 
> You can load it with mentioned method, then fire Activity, hit the inspect 
> button on the process  (sample one line app that shows the icon in imageview) 
> and one of those lines should be the icon.
> Many thanks. 
> 
> On Tue, Sep 15, 2015 at 8:58 PM, John Daniel  > wrote:
> There is a gold icon in the system. I am hopeful that this method will 
> retrieve it, if running on a gold MacBook. If not, people are reporting that 
> it at least displays a silver MacBook icon and that’s as good as I can do on 
> my own.
> 
> John Daniel
> 
> > On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  > > wrote:
> >
> > I am just curious, is there a gold icon in the system or it's a guess that 
> > there should be one ?
> >
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> )
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com 
> 
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com 
> 
> 
> This email sent to xhrus...@gmail.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

Re: Should all CoreData relationships be optional in swift?

2015-09-15 Thread dangerwillrobinsondanger
Maybe a default image is appropriate if the FooType is not set or is optional. 

Sent from my iPhone

> On Sep 16, 2015, at 12:14 PM, Jim Thomason  wrote:
> 
> I'm doing some porting/updating work and came across an issue.
> 
> I have two objects - which we'll call Foo and FooType.
> 
> Every Foo must have a FooType, and every FooType is associated with
> multiple Foos.
> 
> The FooType also has an image associated with it, and the Foo uses that
> image exclusively.
> 
> So I added this:
> 
> class Foo {
>   ...
>   var image : NSImage { get { return self.type.image } }
> 
> }
> 
> The problem is, this image value is used to populate a cell in a Source
> Control List. When I add a new Foo, it's immediately added to the table.
> And it pops up in there before a FooType is associated with it.
> 
> That in turn means that the image getter tries to go through self.type,
> which isn't defined yet.
> 
> How do I fix this? I can't do self.type?.image or if let t = self.type,
> because the type is declared as non-optional and I can't unwrap an optional
> value.
> 
> Presumably, I can just make the type optional, but it's not -really-
> optional, since all Foos _must_ have a type before they're saved. It's a
> mandatory relationship.
> 
> Generalizing wildly, I can see this issue popping up with any relationship
> - if you have a derived property that relies upon a relationship that may
> not have been set yet, you'd fail with an error. So should all
> relationships just be made optional to get around this? That seems like the
> wrong approach.
> 
> Any suggestions?
> 
> -Jim
> ___
> 
> 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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.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

NSSplitViewController : not in Interface Builder library?

2015-09-15 Thread Jerry Krinock
NSSplitViewController was introduced in 10.10.  I’ve read some posts which 
imply that there should be such a thing, with associated NSSplitViewItem 
objects, in the Object Library in Interface Builder.  And it seems like they 
certainly should be in there.  But for the life of me I cannot find any such 
thing.  Does it go by a different name or something?  The only thing close is 
“Vertical Split View” and “Horizontal Split View”, but of course these just 
give me the old NSSplitView and a pair of NSView objects.

I realize I can use a NSViewController, identify it with custom class 
NSSplitViewController, and add the missing splitView outlet, and add the 
NSSplitViewItem objects in code.  But this seems like the kind of kludge that 
would lead to trouble.

Thanks,

Jerry


___

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: Should all CoreData relationships be optional in swift?

2015-09-15 Thread Quincey Morris
On Sep 15, 2015, at 20:14 , Jim Thomason  wrote:
> 
> So I added this:
> 
> class Foo {
>   ...
>   var image : NSImage { get { return self.type.image } }
> 
> }
> 
> The problem is, this image value is used to populate a cell in a Source
> Control List. When I add a new Foo, it's immediately added to the table.
> And it pops up in there before a FooType is associated with it.
> 
> That in turn means that the image getter tries to go through self.type,
> which isn't defined yet.
> 
> How do I fix this?


You can use a default image initially, as has been suggested, and that might be 
the simplest approach. Or, you can declare “type” as FooType! rather than 
FooType, which is a fairly standard thing to do in Swift with related objects 
whose lifetimes are not exactly identical.

When it’s of type FooType!, Swift will let you access the reference in property 
“type” without crashing. (You get a nil.) It would only crash in Swift if you 
then tried to dereference the reference in Swift code. However, if this 
property is accessed via a bindings, the access semantics follow Obj-C rules, 
which means that the binding won’t crash on a nil pointer. I haven’t actually 
tried this, so it’s something of a theory, but I think the overall effect is 
the same as the existing Obj-C behavior that’s generally tolerant of nil values.

The second part of the answer is KVO compliance. You need to ensure that 
establishing the Foo’s link to its FooType is done KVO compliantly for the 
“type” property. This may already be so, depending on how the relationship is 
established. KVO compliance is necessary for both of the above approaches.




___

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: NSSplitViewController : not in Interface Builder library?

2015-09-15 Thread Quincey Morris
On Sep 15, 2015, at 21:57 , Jerry Krinock  wrote:
> 
> NSSplitViewController was introduced in 10.10.  I’ve read some posts which 
> imply that there should be such a thing, with associated NSSplitViewItem 
> objects, in the Object Library in Interface Builder.  And it seems like they 
> certainly should be in there.  But for the life of me I cannot find any such 
> thing.  Does it go by a different name or something?  The only thing close is 
> “Vertical Split View” and “Horizontal Split View”, but of course these just 
> give me the old NSSplitView and a pair of NSView objects.

They’re all there in my project, using Xcode 7 GM candidate. It’s possible that 
IB hides the new controllers under some combination of the following settings:

— In a storyboard vs. a XIB (mine is a storyboard)

— Deployment target (mine is 10.10)

— IB Document format (mine is default(7.0))

— Uses auto-layout or not (mine does)

— Project format (mine is Xcode 6.3-compatible)

— etc.

Maybe Xcode is now like the documentation, where the only complete and accurate 
developer tools are those literally from the future.


___

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

Should all CoreData relationships be optional in swift?

2015-09-15 Thread Jim Thomason
I'm doing some porting/updating work and came across an issue.

I have two objects - which we'll call Foo and FooType.

Every Foo must have a FooType, and every FooType is associated with
multiple Foos.

The FooType also has an image associated with it, and the Foo uses that
image exclusively.

So I added this:

class Foo {
   ...
   var image : NSImage { get { return self.type.image } }

}

The problem is, this image value is used to populate a cell in a Source
Control List. When I add a new Foo, it's immediately added to the table.
And it pops up in there before a FooType is associated with it.

That in turn means that the image getter tries to go through self.type,
which isn't defined yet.

How do I fix this? I can't do self.type?.image or if let t = self.type,
because the type is declared as non-optional and I can't unwrap an optional
value.

Presumably, I can just make the type optional, but it's not -really-
optional, since all Foos _must_ have a type before they're saved. It's a
mandatory relationship.

Generalizing wildly, I can see this issue popping up with any relationship
- if you have a derived property that relies upon a relationship that may
not have been set yet, you'd fail with an error. So should all
relationships just be made optional to get around this? That seems like the
wrong approach.

Any suggestions?

-Jim
___

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: Working with NSTextFields

2015-09-15 Thread Alex Hall
That's what I get for assuming. :) I figured text fields were for editing text, 
and text views were for displaying it. Needless to say, I was completely and 
profoundly wrong! This text view and related pieces are doing precisely what I 
wanted; spellcheck, substitutions, no selecting when the app inserts text, etc. 
I can even support tab and enter for moving/submitting by making my view 
controller the delegate!

My only remaining wonder is about setting the accessibilityHelp property, which 
is giving me the same error it always has: self is immutable. This isn't a 
show-stopper, but it would be really nice to be able to change this according 
to different user actions.
> On Sep 15, 2015, at 13:20, Jens Alfke  wrote:
> 
> 
>> On Sep 15, 2015, at 9:11 AM, Alex Hall  wrote:
>> 
>> * When I call myField.stringValue="some text", that string ("some text") 
>> appears as expected, but it's highlighted. That means that, when the user 
>> starts typing, it disappears, defeating the purpose of the app putting it 
>> there for the user in the first place.
> 
> That’s the standard behavior for text fields. It lets the user tab through a 
> dialog box and either accept the default value or quickly type in a new one.
> 
>> * My field currently doesn't allow spellchecking or auto-correct, but I want 
>> it to. I don't see that option anywhere in the inspectors, for the field or 
>> its child cell.
> 
> This is probably a side effect of the fact that all text fields (and text 
> cells in general) in the window share the same NSTextView, called the “field 
> editor”. So by default they’re using the characteristics of that view.
> 
> You can override either of those behaviors, but it sounds like you may want 
> to use an NSTextView instead of an NSTextField in your UI, since its behavior 
> isn’t typical and you want to enable extra features.
> 
> —Jens
> 


--
Have a great day,
Alex Hall
mehg...@icloud.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

Re: Working with NSTextFields

2015-09-15 Thread Quincey Morris
On Sep 15, 2015, at 17:29 , Alex Hall  wrote:
> 
> I figured text fields were for editing text, and text views were for 
> displaying it.

In fact, text views are the views (as in “NSView", not as in “viewer”) that 
codify *all* of the Cocoa text editing functionality. Text fields are NSControl 
wrappers around text views. The TextEdit utility is an app wrapper around a 
text view.

> My only remaining wonder is about setting the accessibilityHelp property, 
> which is giving me the same error it always has: self is immutable.

You’re going to have to post a few text fragments to show what’s going on, that 
show how the variables are declared. Context is important here.

Keep in mind that with Swift, the error that’s reported is still sometimes a 
secondary error. What it says may not be a good clue to what’s wrong.

___

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

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

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

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

. Re: API to determine status of System Integrity Protection?

2015-09-15 Thread Stephane Madrau
2015-09-14 21:00 GMT+02:00 :

>
> The open() API returns EPERM when you try to access something protected by
> SIP, but EACCES for normal permission errors. So, you could just try to
> write to create a file at /System/foo without root access using open(), and
> use the value returned by errno to determine whether SIP is enabled or not.
>
> Whether that is more or less ugly than parsing the output of csrutil, of
> course, is up to the reader. They’re both pretty non-ideal.
>

What's wrong with using csr_check() and csr_get_active_config(). That's
nothing else than what csrutil uses... Are these functions considered as
SPI ? They are in the kernel sources...
And using SPI shouldn be worse than parsing a shell tool output...

If these are ok, then this code should do it
https://github.com/Piker-Alpha/csrstat/blob/master/csrstat.c

-- 
Stéphane
___

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: . Re: API to determine status of System Integrity Protection?

2015-09-15 Thread Charles Srstka
> On Sep 15, 2015, at 1:37 AM, Stephane Madrau  wrote:
> 
> What's wrong with using csr_check() and csr_get_active_config(). That's
> nothing else than what csrutil uses... Are these functions considered as
> SPI ? They are in the kernel sources...
> And using SPI shouldn be worse than parsing a shell tool output...
> 
> If these are ok, then this code should do it
> https://github.com/Piker-Alpha/csrstat/blob/master/csrstat.c 
> 
> 
> -- 
> Stéphane

Using private APIs is probably the worst possible way to go about doing this 
(and those are private APIs; if they’re not in the system headers, they’re not 
guaranteed not to change in the future, even if they’re currently in the 
source).

Charles

___

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: Identifying a specific Mac model

2015-09-15 Thread John Daniel
There is a gold icon in the system. I am hopeful that this method will retrieve 
it, if running on a gold MacBook. If not, people are reporting that it at least 
displays a silver MacBook icon and that’s as good as I can do on my own.

John Daniel

> On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  wrote:
> 
> I am just curious, is there a gold icon in the system or it's a guess that 
> there should be one ?
> 


___

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

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

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

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

Re: Working with NSTextFields

2015-09-15 Thread Jens Alfke

> On Sep 15, 2015, at 9:11 AM, Alex Hall  wrote:
> 
> * When I call myField.stringValue="some text", that string ("some text") 
> appears as expected, but it's highlighted. That means that, when the user 
> starts typing, it disappears, defeating the purpose of the app putting it 
> there for the user in the first place.

That’s the standard behavior for text fields. It lets the user tab through a 
dialog box and either accept the default value or quickly type in a new one.

> * My field currently doesn't allow spellchecking or auto-correct, but I want 
> it to. I don't see that option anywhere in the inspectors, for the field or 
> its child cell.

This is probably a side effect of the fact that all text fields (and text cells 
in general) in the window share the same NSTextView, called the “field editor”. 
So by default they’re using the characteristics of that view.

You can override either of those behaviors, but it sounds like you may want to 
use an NSTextView instead of an NSTextField in your UI, since its behavior 
isn’t typical and you want to enable extra features.

—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

Re: Identifying a specific Mac model

2015-09-15 Thread Marek Hrušovský
I am just curious, is there a gold icon in the system or it's a guess that
there should be one ?

On Tue, Sep 15, 2015 at 3:59 PM, John Daniel <
etresoft.apple.li...@icloud.com> wrote:

> Thanks! That did the trick. It took a couple of tries to get it working. I
> forgot that the namedImage method returns a scaled down image. it is a
> little counter-intuitive, but you have to scale the image up and then it
> will pick the bigger image in the icns file.
>
> I still don’t know if it will display in gold on a new MacBook, but it
> seems to work on two MacBookPros and an iMac.
>
> John Daniel
> i...@etresoft.com
>
>
>
> > On Sep 14, 2015, at 12:43 PM, Jean-Daniel Dupas 
> wrote:
> >
> > If you just want to current machine icon, just use + [NSImage
> imageNamed:NSImageNameComputer]
> >
> >
>
>
> ___
>
> 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/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.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

Re: best way to implement a clickable grid?

2015-09-15 Thread Jonathan Mitchell

> On 15 Sep 2015, at 01:17, Patrick J. Collins  
> wrote:
> 
> Hi everyone,
> 
> I am looking to implement something that would look somewhat like a
> graphic equalizer.  Meaning, a grid of blocks...  Clicking on a single
> grid block would change the appearance of all cells directly under it..
> So in other words, clicking on 1,1 would turn on 1,1. but clicking 1,5
> woudl turn on 1,5, 1,4, 1,3, 1,2, 1,1…
> 
You might find this useful.

https://github.com/ThesaurusSoftware/TSUniformGrid

Jonathan














___

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: Adding Constraints in Code

2015-09-15 Thread Dave
> On 14 Sep 2015, at 22:51, Jonathan Hull  wrote:
> 
> It looks like these are the constraints inside of the detailView (that hold 
> it’s sub-parts together).  Doesn’t really tell us anything about the 
> constraints holding the detailView itself in place...
> 
> Thanks,
> Jon

No, not explicitly, I didn’t think I needed to since I can add LTWDetailYView’s 
to the exact same StackVIew and it works (e.g. LTWDetailYView stretches in X 
but LTWDetailXView doesn’t).

LTWDetailYView has a layout like this:

LTWDetailYView
NSStackView
Controls


Whereas LTWDetailXView is like this:

LTWDetailXView
Controls

Both views are added to the exact same NSStackView, the driving code is common 
to both views, just the internal details change as per the NIB and the Class 
Implementation.

I’d be happy to try this out, but I’m not sure of the correct constraints in 
the first place, so when I try it I’m not sure if it should work or not!

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

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

Re: Adding Constraints in Code

2015-09-15 Thread Dave
Hi,

I changed the Background Color of the Flipped Clip View and it seems to be 
constrained to the Scroll View anyway, e.g. I set:

pValidationIssueScrollView = Red.
pValidationListStackView = Blue.
pValidationClipView = Green.

I then add one item to the StackView, now when I resize the Window to make it 
wider, the pValidationListStackView and pValidationClipView resize in X to 
match the new ScrollView Size, but the LTWDetailXView doesn’t.

The Background color of the  LTWDetailXView is yellow.

This is so hard to describe, I’ve sent you a screen dump offline.

I really appreciate your help on this.

All the Best
Dave



> On 15 Sep 2015, at 11:46, Dave  wrote:
> 
>> On 14 Sep 2015, at 22:51, Jonathan Hull  wrote:
>> 
>> It looks like these are the constraints inside of the detailView (that hold 
>> it’s sub-parts together).  Doesn’t really tell us anything about the 
>> constraints holding the detailView itself in place...
>> 
>> Thanks,
>> Jon
> 
> No, not explicitly, I didn’t think I needed to since I can add 
> LTWDetailYView’s to the exact same StackVIew and it works (e.g. 
> LTWDetailYView stretches in X but LTWDetailXView doesn’t).
> 
> LTWDetailYView has a layout like this:
> 
> LTWDetailYView
>   NSStackView
>   Controls
> 
> 
> Whereas LTWDetailXView is like this:
> 
> LTWDetailXView
>   Controls
> 
> Both views are added to the exact same NSStackView, the driving code is 
> common to both views, just the internal details change as per the NIB and the 
> Class Implementation.
> 
> I’d be happy to try this out, but I’m not sure of the correct constraints in 
> the first place, so when I try it I’m not sure if it should work or not!
> 
> Cheers
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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

Working with NSTextFields

2015-09-15 Thread Alex Hall
Hello list,
I have an NSTextField, and I can get/set its value by its stringValue property. 
However…

* When I call myField.stringValue="some text", that string ("some text") 
appears as expected, but it's highlighted. That means that, when the user 
starts typing, it disappears, defeating the purpose of the app putting it there 
for the user in the first place. I want to leave the field able to support 
selecting text, but I don't want new text programmatically inserted to be 
selected automatically.

* If I try to set any properties of the field itself, I can't, because "self is 
immutable". For example, in my text field delegate, I have controlTextDidChange 
implemented. It works, but I wanted to update the field's accessibilityHelp 
property in there. When I do
myField.accessibilityHelp="new a11y help"
I get the error "cannot assign to property: 'self' is immutable". My outlet is 
a var, not a let, but I don't think this error is referring to that anyway.

* My field currently doesn't allow spellchecking or auto-correct, but I want it 
to. I don't see that option anywhere in the inspectors, for the field or its 
child cell. I don't want rich text, just spellchecking. Is it hiding somewhere, 
or is this done programmatically?

As always, thank you for your time and help.

--
Have a great day,
Alex Hall
mehg...@icloud.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

Re: Identifying a specific Mac model

2015-09-15 Thread Marek Hrušovský
Can you please tell us the path?
You can load it with mentioned method, then fire Activity, hit the inspect
button on the process  (sample one line app that shows the icon in
imageview) and one of those lines should be the icon.
Many thanks.

On Tue, Sep 15, 2015 at 8:58 PM, John Daniel <
etresoft.apple.li...@icloud.com> wrote:

> There is a gold icon in the system. I am hopeful that this method will
> retrieve it, if running on a gold MacBook. If not, people are reporting
> that it at least displays a silver MacBook icon and that’s as good as I can
> do on my own.
>
> John Daniel
>
> > On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  wrote:
> >
> > I am just curious, is there a gold icon in the system or it's a guess
> that there should be one ?
> >
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.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

Re: Working with NSTextFields

2015-09-15 Thread Alex Hall

> On Sep 15, 2015, at 13:20, Jens Alfke  wrote:
> 
> 
>> On Sep 15, 2015, at 9:11 AM, Alex Hall  wrote:
>> 
>> * When I call myField.stringValue="some text", that string ("some text") 
>> appears as expected, but it's highlighted. That means that, when the user 
>> starts typing, it disappears, defeating the purpose of the app putting it 
>> there for the user in the first place.
> 
> That’s the standard behavior for text fields. It lets the user tab through a 
> dialog box and either accept the default value or quickly type in a new one.

Makes sense. In this app, though, I want to put focus on the field (that is, 
becomeFirstResponder()) then put the cursor after the text the app inserted, 
letting the user continue typing after it without typing *over* it.
> 
>> * My field currently doesn't allow spellchecking or auto-correct, but I want 
>> it to. I don't see that option anywhere in the inspectors, for the field or 
>> its child cell.
> 
> This is probably a side effect of the fact that all text fields (and text 
> cells in general) in the window share the same NSTextView, called the “field 
> editor”. So by default they’re using the characteristics of that view.
> 
> You can override either of those behaviors, but it sounds like you may want 
> to use an NSTextView instead of an NSTextField in your UI, since its behavior 
> isn’t typical and you want to enable extra features.

I'll look into that. I didn't realize a text view could be editable. Thanks.
> 
> —Jens
> 


--
Have a great day,
Alex Hall
mehg...@icloud.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

Re: Identifying a specific Mac model

2015-09-15 Thread John Daniel
Thanks! That did the trick. It took a couple of tries to get it working. I 
forgot that the namedImage method returns a scaled down image. it is a little 
counter-intuitive, but you have to scale the image up and then it will pick the 
bigger image in the icns file.

I still don’t know if it will display in gold on a new MacBook, but it seems to 
work on two MacBookPros and an iMac.

John Daniel
i...@etresoft.com



> On Sep 14, 2015, at 12:43 PM, Jean-Daniel Dupas  wrote:
> 
> If you just want to current machine icon, just use + [NSImage 
> imageNamed:NSImageNameComputer]
> 
> 


___

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