Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Graham Cox
> On 13 Jun 2015, at 11:46 am, Quincey Morris > wrote: > > I also wonder if Swift is going to meet the Graham Cox test: “Will Graham use > it?” I’m picking on Graham (without giving offense, I hope) because he’s a > crusty (though lovable) retrovert who’s still doing manual memory management

Re: NSFontPanel for a modal window

2015-06-13 Thread Graham Cox
> On 13 Jun 2015, at 3:08 pm, Kurt Sutter wrote: > > I then bring up the font panel calling [NSFontPanel sharedFontPanel] > > The font panel comes up, and does not have key focus Just asking for the sharedFontPanel isn’t enough. You still need to show it using -makeKeyAndOrderFront:, and as

Re: NSFontPanel for a modal window

2015-06-13 Thread Kurt Sutter
Thanks, Graham! However, I don’t want the panel to get key focus by default. Just as in TextEdit, the font panel should come up, the focus should however remain with the text window. The user can then e.g. click another font in the font panel (which will update the font in the text window) and

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Michael David Crawford
While I think Swift is just dandy, and see it as a step in the right direction that Apple has chosen to Open Source it, I won't be learning it until it is an ISO standard. The reason is specifically because Apple created Objective-C 2.0 without consulting a standards body. Objective-C has many me

Integrating C++ into Swift

2015-06-13 Thread Uli Kusterer
I have an application that makes use of a large C++ core (used across several platforms). I’d like to move it to Swift, but Swift has no support for C++, so I’d have to add bridging and translation layers in between the two languages written either in C (losing all that object-oriented goodness)

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Uli Kusterer
On 12 Jun 2015, at 17:51, Maxthon Chan wrote: > News outlets says that Objective-C is quickly falling out of people’s > attention and developers are turning away from it to Swift and C++. So what > language will you use to code various parts of your new project? Objective-C? > Swift 2? C++? Or

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Uli Kusterer
On 12 Jun 2015, at 22:48, Jens Alfke wrote: > Even the “if” statement is a method on class Boolean. Objective-C on the > other hand is an awkward combination of Smalltalk objects on top of C. And > the C crap really gets in the way. That’s where Swift really helps. Or to paraphrase the Brad Co

Re: Integrating C++ into Swift

2015-06-13 Thread Quincey Morris
On Jun 13, 2015, at 12:01 , Uli Kusterer wrote: > > Right now, I get the impression that, given I’d have to use ObjC for bridging > anyway, I might as well leave the GUI layer code in ObjC. How are you currently bridging from Obj-C to C++? In theory (I guess) every line of Obj-C code that you

Re: Integrating C++ into Swift

2015-06-13 Thread Uli Kusterer
> On 13 Jun 2015, at 12:26, Quincey Morris > wrote: > > On Jun 13, 2015, at 12:01 , Uli Kusterer wrote: >> >> Right now, I get the impression that, given I’d have to use ObjC for >> bridging anyway, I might as well leave the GUI layer code in ObjC. > > How are you currently bridging from Ob

Re: Integrating C++ into Swift

2015-06-13 Thread Rick Mann
> On Jun 13, 2015, at 12:34 , Uli Kusterer wrote: > > Yeah, using ObjC++ right now. Swift does not have any way to talk to C++. > Best on I know to do is go via C (e.g. by creating C++ methods declared as > 'extern “C”’) or ObjC (by creating an outwardly ObjC class that is ObjC++ > internally

RE: Menu Bar App: [NSStatusItem popUpStatusItem] : Menu shows popupmenu too high

2015-06-13 Thread Dan Stenning
thanks for the reply but i’m afraid that suggestion didn’t work either :( // [pimpl->getView() setMenu:pimpl->theMenu]; [pimpl->statusItem setMenu:pimpl->theMenu]; PS - I have a screenshot i could provide but does this apple mailing list email server filter jpegs or png’s out ?

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Michael David Crawford
"It is expected of me to learn languages, find out what they’re good for, and apply the right tool to the right job." The software director at a highly successful, well-known company I once consulted for - that I would prefer not to name - emailed us all to say that the company would not use Objec

Re: Integrating C++ into Swift

2015-06-13 Thread dangerwillrobinsondanger
There are basically two options. Expose a C interface to your C++ or use Objective-C++ (this is the easiest option). Sent from my iPhone > On 2015/06/13, at 10:03, Rick Mann wrote: > > >> On Jun 13, 2015, at 12:34 , Uli Kusterer >> wrote: >> >> Yeah, using ObjC++ right now. Swift does n

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Paul Scott
Having perused the Swift documentation, viewed the pertinent Apple sessions, and listened to the arguments (mostly pro) surrounding Swift since its initial release, I’ve decided that the language provides (me) no additional benefits over Objective-C and C++, and indeed, Swift adds additional com

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Maxthon Chan
I don’t think Objective-C will ever be shut down since Swift also links to libobjc runtime library, which means Swift is, technically, a dialect of Objective-C with some syntactic sugar and compile-time checks allowing some more advanced programming techniques. Think this like the relationship b

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Quincey Morris
On Jun 13, 2015, at 15:33 , Maxthon Chan wrote: > > Swift is, technically, a dialect of Objective-C with some syntactic sugar and > compile-time checks allowing some more advanced programming techniques. It’s not a dialect of Obj-C because it can express constructs that are not representable i

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Quincey Morris
I don’t want to take issue with the opinions being expressed in this thread, but I was struck by the argument you used in coming to your opinion: On Jun 13, 2015, at 15:27 , Paul Scott wrote: > > in practice there is little to justify the existence of Swift […] > > When C++ and Java appeared o

Re: Going back to non-ARC

2015-06-13 Thread John Brownie
After much trial and error, I seem to have everything working again, back under ARC. The problem was a macro that was too ambitious for Cocoa: NCFOBJECT_OPERATOR(NSArrayRef) which expands to: inline NCFObject(NSArrayRef cfObject) { InitializeSelf(cfObject, false); } inline

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Maxthon Chan
Swift on Linux does not really need a separate standard Linux library as long as the Linux version of Foundation is up to speed. Apple can choose to open source their own implementation of Foundation (libobjc, libdispatch and libBlocksRuntime are already open source) or contribute code to an alt

Re: NSFontPanel for a modal window

2015-06-13 Thread Graham Cox
> On 13 Jun 2015, at 6:33 pm, Kurt Sutter wrote: > > Calling setWorksWhenModal:YES and/or setBecomesKeyOnlyIfNeeded:YES does not > seem to resolve the issue either. > > I am at a loss here. > What happens if you set those to YES first, then show it with -orderFront: (i.e. without the makeK

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Carl Hoefs
> On Jun 13, 2015, at 3:27 PM, Paul Scott wrote: > > Swift insinuates itself into the developer community with typical grandiose > marketing hype. But what practical value does it really offer? What failing, > besides a distaste of Objective-C by some — excluding myself — required a > whole n

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Graham Cox
> On 13 Jun 2015, at 8:09 pm, Michael David Crawford > wrote: > > The problem I've got is that those who pay for iOS and OS X > development have it in their heads that one must know either > Objective-C or Swift. You do need one of those to code for Apple devices, even if all your own code i

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Graham Cox
> On 14 Jun 2015, at 6:41 am, Michael David Crawford > wrote: > > that the company would not use Objective-c because he regarded > the syntax as ugly. As stupid as complaining that German is ugly because it has too many umlauts and eszetts. If you want to be able to fully function in Germany

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Maxthon Chan
The language complexity issue of C++ is one of the main reason it put me off so much. And there is someone out there who posted a method of creating an iOS app with no Objective-C code at all but quite a lot of runtime abusing. The same method can be used on C++ but that requires some understand

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Michael David Crawford
I don't need either Swift nor Objective-C to code for OS X or iOS, I need them to code for Cocoa or Cocoa Touch. To code for OS X or iOS in C++ I can use ZooLib which I prefer quite a lot to any other framework I've ever used. Andy Green wrote in response to Apple's abandonment of Bedrock. If An

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Britt Durbrow
> On Jun 13, 2015, at 1:41 PM, Michael David Crawford > wrote: > I'm not > completely clear as to why, but among the reasons I enjoy C, C++, > Objective-C and Assembly Code is that I can do tweaky little > optimizations like reordering data accesses so as to reduce cache > misses. I also like

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Jonathan Hull
> On Jun 13, 2015, at 4:42 PM, Carl Hoefs > wrote: > > Bingo. Even after reading all the posts in this thread, I still don’t know > what problem Swift addresses, and no one seems to be able to answer that > question — not even Apple in its marketing hype. Do you remember the Goto-Fail bug t

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Gary L. Wade
To answer your question, Swift adds an expressiveness for nullability to APIs, more type expressiveness on collection constituents, a better pattern for if/else if/else if/.../else for object-equality testing that mirrors C switch/case, less conversion needed between analogous C types and Cocoa-

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Gary L. Wade
> On Jun 13, 2015, at 5:14 PM, Michael David Crawford > wrote: > > To code for OS X or iOS in C++ I can use ZooLib which I prefer quite a > lot to any other framework I've ever used. > … > Available for Software Development in the Portland, Oregon Metropolitan Area. And that's an example of ho

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Gary L. Wade
> On Jun 13, 2015, at 5:14 PM, Michael David Crawford > wrote: > > To code for OS X or iOS in C++ I can use ZooLib which I prefer quite a > lot to any other framework I've ever used. > … > Available for Software Development in the Portland, Oregon Metropolitan Area. And that's an example of how

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Quincey Morris
On Jun 13, 2015, at 18:20 , Gary L. Wade wrote: > > To answer your question, Swift adds […] To get more specific, I just made a quick pass through the Swift documentation, and came up with the following list of things where Swift adds useful functionality and/or features that we’ve been asking

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Carl Hoefs
Thanks for the informative listing. So Swift offers refinements (not a paradigm shift like object orientation over functional), many of which could be added to ObjC, and many of which I wouldn’t want. I guess I was trying to find the main, overwhelming purpose driving the adoption of Swift. I th

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Quincey Morris
On Jun 13, 2015, at 19:06 , Carl Hoefs wrote: > > many of which could be added to ObjC, In a lot of cases, they *can’t* be added to Obj-C, because Obj-C *is* C. That is, if you restrict yourself to the C parts of the language, it’s C99-conformant. That limits syntax in the language generally.

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Michael David Crawford
Gary, Doubtlessly my availability for software development is not due to my preference for C++ nor ZooLib, but because I am so outspoken regarding ethics, as well as so explicitly public about my mental illness of Bipolar-Type Schizoaffective Disorder. Consider for example that I was expelled fro

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Rick Mann
> On Jun 13, 2015, at 19:06 , Carl Hoefs wrote: > > Thanks for the informative listing. So Swift offers refinements (not a > paradigm shift like object orientation over functional), many of which could > be added to ObjC, and many of which I wouldn’t want. I guess I was trying to > find the m

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Michael David Crawford
I strongly support program correctness but regard C++ is the best at facilitating that for me personally. However I'm not a language zealot, and it took me years to figure out how to get C++ right. Pick out a few apps completely at random in the app store. Sort the reviews by most-negative first

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Roland King
> > Pick out a few apps completely at random in the app store. Sort the > reviews by most-negative first. Last time I tried the vast majority > complained of crashes, user interfaces that did not work or were > sorely confusing or end-user data loss. I held back an old version of > Skype for y

Re: NSFontPanel for a modal window

2015-06-13 Thread Kurt Sutter
It does not help — the panel i actually already in front when it appears, and calling -orderFront: does not help. It only works when it is the key window. Kurt > On 14 Jun 2015, at 01:40, Graham Cox wrote: > > >> On 13 Jun 2015, at 6:33 pm, Kurt Sutter wrote: >> >> Calling setWorksWhenModal

Re: NSFontPanel for a modal window

2015-06-13 Thread Ken Thomases
On Jun 13, 2015, at 12:08 AM, Kurt Sutter wrote: > I have a modal window (run with [NSApp runModalForWindow:]) that sports a > view that is a descendant of NSTextView. The view has key focus and text is > selected therein. I then bring up the font panel calling [NSFontPanel > sharedFontPanel]

Re: NSFontPanel for a modal window

2015-06-13 Thread Kurt Sutter
Good point. Yes, I have some changeFont: selectors in some of my classes, but I don’t think any of them should be in the responder chain in that situation. Anyway, when I place stops in each of them, I see that none of them gets called until I make the font panel the key, whereupon the changeFon

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Paul Scott
> On Jun 13, 2015, at 3:59 PM, Quincey Morris > wrote: > > I don’t want to take issue with the opinions being expressed in this thread, > but I was struck by the argument you used in coming to your opinion: > > On Jun 13, 2015, at 15:27 , Paul Scott > wrote: >> >>