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

tutorial arrow slow to redraw on box move #18

Open
Neon22 opened this issue Dec 15, 2024 · 2 comments
Open

tutorial arrow slow to redraw on box move #18

Neon22 opened this issue Dec 15, 2024 · 2 comments

Comments

@Neon22
Copy link

Neon22 commented Dec 15, 2024

In 0.2.19 when using a ltk.Tutorial() like so:

ltk.Button("Tutorial 1: Overview", ltk.proxy(lambda event: tutorial1()))

and

def tutorial1():
    ltk.Tutorial([
        ("#checkky",
         "click",
         ltk.VBox(
             ltk.Text("Tutorial line 1"),
             ltk.Text("- more stuff you need to know")
         ))
        ]).run()

Having changed the pyodide ref to add leader line javascript library like so:

<!-- Import jQuery - used in ltk/jquery.py -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-ui@1.13.2/dist/jquery-ui.min.js"></script>
<script src=" https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.3/leader-line.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/base/jquery-ui.css"/>

The tutorial arrow is once again appearing.

However if the box is dragged to a new location, the arrow will not redraw until the mouse moves over the tutorial box again.

Preferably? it would update whilst dragging

@laffra
Copy link
Collaborator

laffra commented Dec 16, 2024

This did not work due to how PyScript passes Python dicts to JS. This changed over time. Should work again with work-around in ltk.Step. See a live demo online: https://laffra.pyscriptapps.com/ltk-tutorial

@Neon22
Copy link
Author

Neon22 commented Dec 19, 2024

Thanks. This working again in 2.20

However one more wrinkle.
If the next step in the tutorial is down the page and scrolling is required to focus it - no scrolling occurs.
I'm pretty sure this did work in 0.1.43

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

2 participants