alex-ong / NESTrisOCR

OCR for statistics in NESTris
24 stars 7 forks source link

Set requirements for osx #8

Closed timotheeg closed 4 years ago

timotheeg commented 4 years ago

Small update for the OSX requirements.

The calibrator app does not render well on OSX yet. I'll see if I can spend some time to look into it, but no promises 😰😅.

image

alex-ong commented 4 years ago

It looks close! Though the image is missing and buttons seem to be missing.

timotheeg commented 4 years ago

The buttons seem to be a known issue in OSX python tk. They're not missing, they render white text on white background 😑. And sadly the tk API to set button's foreground and background color don't work in OSX. Sigh...

The good news is that the buttons do work! And so does the autodetection btw, which is awesome!

alex-ong commented 4 years ago

Great! That means everything functionally works (though aesthetically its trash).

alex-ong commented 4 years ago

Looks like we shoudl be able to pip install tkmacosx and replace tk.Button with tkmacosx.Button

Probably just need to wrap it into an OSAgnosticTkButton class

import OSAgnosticTkButton.Button as Button

timotheeg commented 4 years ago

I also just spotted another possible workaround using the highlightbackground property of Buttons. I'll try later, and tkmacosx too, to see if that works.

alex-ong commented 4 years ago

Yeah reading around the highlightbackground is hacky and might result in weirdness with the layout. Either way making a new wrapper for Button and then either using plain tk.Button or macimpl_highlight_bg is gonna happen.