Re: different behaviour for NSView.drawRect_

Ronald Oussoren via Pyobjc-dev <[email protected]> Wed, 2 Jan 2019 14:59:20 +0100
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
--===============8517678492691791431==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_24F0A5E4-9E77-4C28-9731-23BE7ACBA574"


--Apple-Mail=_24F0A5E4-9E77-4C28-9731-23BE7ACBA574
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


=E2=80=94

Twitter: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/

> On 2 Jan 2019, at 12:39, Frederik Berlaen <[email protected]> =
wrote:
>=20
> Hi!
>=20
> I noticed different behaviour of macOS calling my nsView subclass =
drawRect_ method, when I run a script  directly in terminal or from =
within my app: DrawBot (http://www.drawbot.com =
<http://www.drawbot.com/>)
>=20
> The python version and installed packages are the same, the most =
current ones from pip.
>=20
> The window is build with vanilla (a pythonic cocoa wrapper) =
https://github.com/typesupply/vanilla =
<https://github.com/typesupply/vanilla>
>=20
> <viewIssue.py>
>=20
> When this script is executed inside DrawBot: I get, based on my screen =
(retina or an old cinema HD), lots of drawRect_ callback with fixed =
width and height.
>=20
> When executed in no-app world, terminal: I get a single callback on my =
drawRect_ with the size of the visible rect.
>=20
> I fully understand the difference in performance and why this is =
happening.
>=20
>=20
> BUT:
>=20
> Im unable to toggle between those two settings. I don't know what or =
where I have to change a setting to get a specific behaviour: =20
> * tilled drawRect_ callbacks
> * a visible rect drawRect callback
>=20
>=20
>=20
> please point me in the right direction
>=20
> (If this question is posted in the wrong place, I happily repost it =
elsewhere)

This could be related to the SDK the main binary is linked to (the =
application stub from py2app vs. the python executable). =20

P.S. This is just a quick reply, I haven=E2=80=99t tried to verify my =
hunch.

Ronald=

--Apple-Mail=_24F0A5E4-9E77-4C28-9731-23BE7ACBA574
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div class=3D"">
<div style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;">=E2=80=94</div><div style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><br =
class=3D""></div><div style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, =
0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;">Twitter: @ronaldoussoren</div><div =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;">Blog: <a =
href=3D"https://blog.ronaldoussoren.net/" =
class=3D"">https://blog.ronaldoussoren.net/</a></div>
</div>
<div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 2 Jan 2019, at 12:39, Frederik Berlaen &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><meta =
http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii" =
class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D""><div class=3D""><div =
class=3D"">Hi!</div><div class=3D""><br class=3D""></div><div class=3D"">I=
 noticed different behaviour of macOS calling my nsView subclass =
drawRect_ method, when I run a script &nbsp;directly in terminal or from =
within my app: DrawBot (<a href=3D"http://www.drawbot.com/" =
class=3D"">http://www.drawbot.com</a>)</div><div class=3D""><br =
class=3D""></div><div class=3D"">The python version and installed =
packages are the same, the most current ones from pip.</div><div =
class=3D""><br class=3D""></div><div class=3D"">The window is build with =
vanilla (a pythonic cocoa wrapper)&nbsp;<a =
href=3D"https://github.com/typesupply/vanilla" =
class=3D"">https://github.com/typesupply/vanilla</a></div><div =
class=3D""><br class=3D""></div><div class=3D""></div></div></div><span =
id=3D"cid:[email protected]">&lt;viewIssue.py&g=
t;</span><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
line-break: after-white-space;" class=3D""><meta =
http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii" =
class=3D""><div class=3D""><div class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">When this script is executed inside =
DrawBot: I get, based on my screen (retina or an old cinema HD), lots of =
drawRect_ callback with fixed width and height.</div><div class=3D""><br =
class=3D""></div><div class=3D"">When executed in no-app world, =
terminal: I get a single callback on my drawRect_ with the size of the =
visible rect.</div><div class=3D""><br class=3D""></div><div class=3D"">I =
fully understand the difference in performance and why this is =
happening.</div><div class=3D""><br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">BUT:</div><div class=3D""><br =
class=3D""></div><div class=3D"">Im unable to toggle between those two =
settings. I don't know what or where I have to change a setting to get a =
specific behaviour: &nbsp;</div><div class=3D"">* tilled drawRect_ =
callbacks</div><div class=3D"">* a visible rect drawRect =
callback</div><div class=3D""><br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div =
class=3D"">please point me in the right direction</div><div class=3D""><br=
 class=3D""></div><div class=3D"">(If this question is posted in the =
wrong place, I happily repost it =
elsewhere)</div></div></div></div></blockquote><div><br =
class=3D""></div>This could be related to the SDK the main binary is =
linked to (the application stub from py2app vs. the python executable). =
&nbsp;</div><div><br class=3D""></div><div>P.S. This is just a quick =
reply, I haven=E2=80=99t tried to verify my hunch.</div><div><br =
class=3D""></div><div>Ronald</div></body></html>=

--Apple-Mail=_24F0A5E4-9E77-4C28-9731-23BE7ACBA574--


--===============8517678492691791431==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8517678492691791431==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev

--===============8517678492691791431==--