Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Andreas Höschler
Hi Quincey, thanks a lot for your response. Please read below ... >> This should in a view with size {851, 899} get me a purple line starting >> close to the lower left corner and ending close to the top right corner. But >> that's not the case. The picture is drawn zoomed in!?? > > I’m not

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread sqwarqDev
> On 15 Jan 2016, at 03:36, Charles Jenkins wrote: > > there’s no way for the end user to create them. A combination of AppleScript, sed and awk will pretty much do anything you can imagine in terms of text formatting, and they’re all included on you mac already; no need

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Charles Jenkins
Thank you, squarqDev and Charles! I’ll give sed/awk a go! Quincey, your responses are normally very helpful, so I’m sorry I picked an example that bothered you. It’s not that it’s too much trouble for me to manually fix a typo like “let half = numerator /2”; I just wanted a completely

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread sqwarqDev
> On 15 Jan 2016, at 17:38, sqwarqDev wrote: > > tell application "Xcode" > tell source document 1 > set _sourceCode to contents > > -- do shell script //do all your formatting here BTW, please don’t put a ‘do shell

Auto Layout and Multiline labels iOS 8

2016-01-15 Thread Daniel Phillips
Hello group, I am really stuck and I would really appreciate your thoughts on something - I’ve got a custom UIView which I want to use in a few places in my app, I have a bunch of labels, some of which are multiline. The layout of my view is a kind of 2 column style, on the left I have 3

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Gary L. Wade
> On Jan 15, 2016, at 10:15 AM, Quincey Morris > wrote: > > …number of pixels you get back will vary according to which Mac you run this > on. …or on which screen you're using. You can see the point/pixel disparity more easily by adding a non-Retina

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Quincey Morris
On Jan 15, 2016, at 04:49 , Charles Jenkins wrote: > > so I’m sorry I picked an example that bothered you. It’s not that it’s too > much trouble for me to manually fix a typo like “let half = numerator /2”; I > just wanted a completely innocuous example And I’m sorry I

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Quincey Morris
On Jan 15, 2016, at 03:42 , Andreas Höschler wrote: > > It seems I have a lack of understanding of the difference of points and > pixels. With “retina” displays, there can be 2 or 3 pixels for each unit of the drawing coordinate system (points). When you did this: >

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Charles Jenkins
Quincey, That’s a fantastic suggestion! I work in VS all day, and I’m quite happy with how I can set up formatting rules in it. If VS Code is as rich for Swift, I’ll be able to do most of what I want automatically within it. --  Charles On January 15, 2016 at 13:47:47, Quincey Morris

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Quincey Morris
On Jan 15, 2016, at 11:24 , Andreas Höschler wrote: > > However, I generated the image rep with a 851 x 899 view and wrote it into a > PNG file (code in earlier mail). Yes, I saw, but you didn’t include (or I couldn't find) the log output that showed the size of the

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Jens Alfke
> On Jan 15, 2016, at 10:47 AM, Quincey Morris > wrote: > > — You have a utility that assists conversion from (say) Obj-C to Swift by > reformatting at least the easy things according to the destination language > syntax. This is the use case that the

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Andreas Höschler
Hi Quincey, > On Jan 15, 2016, at 11:24 , Andreas Höschler > wrote: >> >> However, I generated the image rep with a 851 x 899 view and wrote it into a >> PNG file (code in earlier mail). > > Yes, I saw, but you didn’t include (or I couldn't

Looking at moving part of our iOS app become an iOS framework to be used in other apps.

2016-01-15 Thread Alex Zavatone
And this framework would be utilized by other applications. However, a good amount of app startup and config is triggered in the appDelegate, same as push notification, opening the app via URLs and other appDelegate related tasks would conflict with the appDelegate of the app using the

Re: Looking at moving part of our iOS app become an iOS framework to be used in other apps.

2016-01-15 Thread Alex Kac
I created a singleton called “” that I moved all of that to. That way even my windows, my logging, my push, everything that is shared between my OS X and iOS code and extensions would use that instead of the App Delegate. With that in place, very little if anything calls the app delegate

Re: Looking at moving part of our iOS app become an iOS framework to be used in other apps.

2016-01-15 Thread Jens Alfke
> On Jan 15, 2016, at 1:31 PM, Alex Zavatone wrote: > > However, a good amount of app startup and config is triggered in the > appDelegate, same as push notification, opening the app via URLs and other > appDelegate related tasks would conflict with the appDelegate of the app >

Re: Looking at moving part of our iOS app become an iOS framework to be used in other apps.

2016-01-15 Thread Alex Zavatone
On Jan 15, 2016, at 4:56 PM, Jens Alfke wrote: > >> On Jan 15, 2016, at 1:31 PM, Alex Zavatone wrote: >> >> However, a good amount of app startup and config is triggered in the >> appDelegate, same as push notification, opening the app via URLs and other

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Graham Cox
> On 15 Jan 2016, at 10:42 PM, Andreas Höschler wrote: > > But how does NSBitmapImageRep know which pixel resolution to choose? How does > it derive Pixels=1702x1798 when I create the imageRep with a {{0, 0}, {851, > 899} rect It has a ‘size’ property which can be

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Ken Thomases
On Jan 15, 2016, at 10:27 PM, Graham Cox wrote: > > I have a need to draw as if to the entire screen as an overlay. > Where I’m having a problem is that I need the overlay content to match up to > objects drawn in another view, in another window. This view can be

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Ken Thomases
On Jan 15, 2016, at 11:31 PM, Graham Cox wrote: > > What isn’t working is correctly setting the dirty rects when part of the view > needs to be refreshed. This is what has been leading me astray - because the > dirty region is misaligned, the drawing I’m doing is

Screen <--> View Coordinate system conversion

2016-01-15 Thread Graham Cox
I have a need to draw as if to the entire screen as an overlay. For this purpose I have created an invisible window that covers the entire desktop, and in that I have a view set as its contentView in which I can draw my content in the normal manner (-drawRect:, etc). The window and view are

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Roland King
> On 16 Jan 2016, at 12:27, Graham Cox wrote: > > > summary: view -> window -> screen -> window -> view > > > Tried this and many variants of it, nothing works - the coordinates I end up > with are not in the visible part of my overlay so don’t appear. > > > A

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Graham Cox
> On 16 Jan 2016, at 4:10 PM, Ken Thomases wrote: > > NSView* view1 = /* ... */; > NSRect rect = /* some rect in view1's internal coordinate space (relative to > its bounds, not its frame) */; > NSView* view2 = /* some view in another window */; > > rect = [view1

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Graham Cox
> On 16 Jan 2016, at 5:02 PM, Ken Thomases wrote: > > What is calling -setNeedsDisplayInRect:, in response to what event or > occurrence, and with what rect? It’s complicated, but events that start off in view1, and also draw stuff there, end up also drawing overlaid

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Charles Srstka
> On Jan 14, 2016, at 2:57 PM, Quincey Morris > wrote: > > On Jan 14, 2016, at 12:36 , Charles Jenkins > wrote: >> >> I keep eyeing a program that you can install to work with Xcode and >> autoformat source