> On Aug 25, 2016, at 5:44 AM, Mojca Miklavec <[email protected]> wrote:
> 
> Hi,
> 
> I'm moving the discussion from the user mailing list to the developer
> one, hoping to catch attention of more experienced developers there.
> 
> To summarize.
> 
> Tk fails to compile on Snow Lepard due to the following chunk of code:
> 
>    MacDrawable *macDraw = (MacDrawable *) d;
>    NSWindow *win = TkMacOSXDrawableWindow(d);
>    int scalefactor = 1;
>    if (win && [win respondsToSelector:@selector(backingScaleFactor)]) {
>        scalefactor = ([win backingScaleFactor] == 2.0) ? 2 : 1;
>    }
> 
> The function backingScaleFactor has only been added in 10.7 and
> returns a floating point number.
> 
> On 10.6 the "if" sentence is false, so the "scalefactor = ..." never
> gets executed. The problem is that 10.6 believes that [win
> backingScaleFactor] returns "id" rather than a floating point number
> (it doesn't know the function after all) and throws a compile error
> because id cannot be compared with a floating point (2.0).

tk isn't the first program to need to deal with Retina displays. Can we find 
any other program that uses NSWindow's backingScaleFactor selector and see how 
it handles it?

_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to