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

How should I scroll the canvas, is there an API to generate a scroll canvas? #3671

Open
HoChihchou opened this issue Aug 15, 2024 · 2 comments

Comments

@HoChihchou
Copy link

I need to make an interface that can scroll up and down

@muescha
Copy link
Contributor

muescha commented Aug 15, 2024

for help you need provide more details - maybe show also your existing code.

@asmagill
Copy link
Member

Generally speaking, hs.canvas objects don't scroll. You can mimic something similar programmatically by changing the location of objects within the canvas, and objects with positions outside of the canvas's frame (i.e. positions with negative numbers or positions greater than the height/width of the canvas) will "disappear" in the sense that they won't be displayed, but there is no mechanism for doing it automatically -- you have to move them programatically.

If you want a truly scrolling window in the traditional application style, most likely you need to be using hs.webview, which displays web pages (either remote or locally/programmatically generated). Full HTML and Javascript is supported... for the most part if Safari can render it, hs.webview can as well.

But as @muescha says, more details or seeing some of your existing code would help in determining what the best solution might be.

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

3 participants