typemytype / drawbot

http://www.drawbot.com
Other
398 stars 61 forks source link

Output does not scroll up to show last line #506

Open frankrolf opened 1 year ago

frankrolf commented 1 year ago

I’ve been noticing that the output section does not (no longer?) scroll up to show the last line; this means that I need to scroll up manually to see any tracebacks/errors.

I tried a different font (just in case), but this seems to be consistent behavior.

Using DrawBot 3.129 on macOS 13.0.1

typemytype commented 1 year ago

this still works...

import vanilla

w = vanilla.Window((300, 300))
w.t = vanilla.TextEditor((0, 0, 0, 0), "abc\n" * 100)
w.open()

ts = w.t.getNSTextView().textStorage()
w.t.getNSTextView().scrollRangeToVisible_((len(ts), 0))
justvanrossum commented 1 year ago

I've noticed it, too.

image
typemytype commented 1 year ago

the scrolling code works only the view is not updated somehow... I tried already to add the same runUntilDate trick without luck

typemytype commented 1 year ago

silly:

when calling this twice it works again --> edited: in RoboFont but not in DrawBot, dont get it...

https://github.com/typemytype/drawbot/blob/master/drawBot/ui/codeEditor.py#L1524

def scrollToEnd(self):
    range = (self.getNSTextView().string().length(), 0)    
    self.getNSTextView().scrollRangeToVisible_(range)
    self.getNSTextView().scrollRangeToVisible_(range)