Open quasarbright opened 6 years ago
Something else I noticed: using app.button('Accessibility', app.showAccess, icon='ACCESS')
and scrolling through fonts with trackpad works fine.
I've seen this issue (with the scroll pane) raised before - issue #337 It's not an issue with appJar, but instead a problem with your python/tcl installation on your Mac.
It's discussed here: https://stackoverflow.com/questions/16995969/inertial-scrolling-in-mac-os-x-with-tkinter-and-python
With some suggestions on how to resolve it. I can't reproduce it on my Mac, so can't suggest anything more...
one suggestion involved a try catch with root.mainloop() in tkinter (https://stackoverflow.com/a/36667213/5651606). How would this be done in appJar?
I would look to upgrade your version of tcl/python first.
If that doesn't work, you can go in and edit the appJar file. Search for the go function (def go
), and scroll to the end of it, where you'll find:
# start the main loop
try:
self.topLevel.mainloop()
except(KeyboardInterrupt, SystemExit) as e:
gui.trace("appJar stopped through ^c or exit()")
self.stop()
except Exception as e:
self.exception(e)
self.stop()
You'll want to try to merge this with the code given on the slashdot article:
while True:
try:
root.mainloop()
break
except UnicodeDecodeError:
pass
Maybe something like this:
while True:
try:
self.topLevel.mainloop()
except(KeyboardInterrupt, SystemExit) as e:
gui.trace("appJar stopped through ^c or exit()")
self.stop()
break
except UnicodeDecodeError:
gui.trace("appJar caught UnicodeDecodeError - possible scrolling issue?")
pass
except Exception as e:
self.exception(e)
self.stop()
break
One slight edit to the above, add a break
after calling mainloop()
:
while True:
try:
self.topLevel.mainloop()
break
except(KeyboardInterrupt, SystemExit) as e:
gui.trace("appJar stopped through ^c or exit()")
self.stop()
break
except UnicodeDecodeError:
gui.trace("appJar caught UnicodeDecodeError - possible scrolling issue?")
pass
except Exception as e:
self.exception(e)
self.stop()
break
Oh, and if it works, do let me know....
This stops the crashing, but produces some strange behavior:
In the code I provided, which used a scrollPane, scrolling with the trackpad either does nothing or scrolls an unpredictable distance with a delay of a second or two. Scrolling by dragging the scroll bar works normally. Also, usually, when you hover over the scroll bar or drag it, it turns a darker gray and goes back to light gray after the mouse leaves it or is released. Now, it stays dark until you focus another window. The same happens in a table widget which is long enough to require scrolling. It's good that it fixes the crashing, but it isn't usable with trackpad.
Scrolling through the fonts after using app.button('Accessibility', app.showAccess, icon='ACCESS')
works as it did before (properly scrolling with trackpad)
I'm not too surprised that you get strange behaviour - catching the exception and restarting the mainloop is a proper cludge!
The table widget is inside a scrollPane, so I'd expect to see the same behaviour from both.
The fonts are displayed in a listbox widget, which uses a really simple scrollable widget implementation, missing most of the features of the scrollpane.
I can't reproduce the error, so I can't try to troubleshoot it. I do all of my development on a mac (although it's pretty old) and don't have any issues, and haven't had problems on my Pi or the Windows machines at school.
Could you run your code with the -v
flag, and let me know exactly what versions you're on?
appJar: 0.93.0 Python: 3.5.2 TCL: 8.5, TK: 8.5 Platform: Darwin pid: 73349
locale: en_US
I get the exact same crash when I try to use a tree on mac. Code coudn't be simpler:
with gui("Version 1.0") as app:
app.setSize(300,1000)
app.addTree('t1',someXML)
appJar: 0.93.0 Python: 3.7.0 TCL: 8.5, TK: 8.5 Platform: Darwin pid: XXXXX
locale: en_US
Didn't try to update my installations (don't want to mess with my system), outside of an update/upgrade brew.
OK, I'm now seeing this same issue on my current installation (slightly newer mac).
As mentioned earlier - it is an issue with TCL and not appJar, but I will look to see what can be done about it...
I'm running on appJar 0.93.0 and python 3.5.2. My hardware is a 2018 Macbook Pro 15". I'm running on MacOS High Sierra 10.13.6. When I run the app, it works fine. I can scroll by clicking and dragging the scroll bar. However, when I try to scroll with the trackpad, the app crashes. Here is the code and error message:
code:
error message:
Trying to scroll up while already at the top of the page doesn't crash it, but scrolling down to view the rest does crash it.