Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(scroll! area :to :top) not always working #179

Open
mmower opened this issue Oct 4, 2014 · 4 comments
Open

(scroll! area :to :top) not always working #179

mmower opened this issue Oct 4, 2014 · 4 comments

Comments

@mmower
Copy link

mmower commented Oct 4, 2014

Hi.

I'm following along with the REPL tutorial using Clojure 1.6.0 and SeeSaw 1.4.5-STABLE.

Trying to use (scroll! area :to :top) works one or twice but mostly does nothing. There's no error, the function returns the 'area' JTextArea as expected, but the scroll to the top does not happen.

Can anyone else reproduce this?

Best,

Matt

@mmower mmower changed the title Scroll to top not always working (scroll! area :to :top) not always working Oct 4, 2014
@mmower
Copy link
Author

mmower commented Oct 4, 2014

Actually it seems that the scroll! function is not, in general, reliable since I've found that :to :bottom and :to [:line 50] are also pretty unreliable for me.

@daveray
Copy link
Collaborator

daveray commented Oct 5, 2014

It seems to work consistently for me on OSX. Try forcing the call onto the UI thread in case it's Swing threading weirdness: (invoke-now (scroll! area :to :top))

@soverton
Copy link

If anyone is interested, I stumbled upon a possible workaround (this worked for me twice).
After the area is wrapped in a scrollable, I called (scroll! area :to [:line 0]), then calling (scroll! area :to :bottom) and (scroll! area :to :top) both worked. Maybe the widget just needs to be initialized by scrolling to line 0 first?

@cwillia9
Copy link

I was having this problem as well. In my case I was trying to do the scroll! inside of a b-do. Kind of like this

(bind 
    my-atom
    (property my-text-component :text)
    (b-do [_] (scroll! my-text-component :to :top))

What I had to do was

(bind 
    my-atom
    (b-do [t] 
      (text! my-text-component t)
      (scroll! my-text-component :to :top))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants