Skip to content

Conversation

alex-schulster
Copy link

What?

This PR adds the implementation for an async version of the TkinterMapView widget (called AsyncTkinterMapView).

Why?

If willing to use this widget in an application that makes use of async tasks rather than threads, the original threaded version won't work. See issue #151.

How?

The implementation is basically a copy of the original class with every thread replaced by async actions. This is not pretty, but it works fine for basic usage. A basic example using this implementation is provided.

No thread involved. Everything is handled with async tasks.
Simple window inspired from original example. Simply replaced
TkinterMapView with its async version.
@alex-schulster alex-schulster mentioned this pull request Jan 22, 2025
@mke21
Copy link

mke21 commented Jan 23, 2025

Nice work, only remark: You forgot to update the requirements. You are using aiohttp but it's not installed with the requirements.txt nor with the setup.py.

Update both `requirements.txt` and `setup.py`
@alex-schulster
Copy link
Author

Oops, you're absolutely right.
This is now fixed. Thanks for the insight.

@mke21
Copy link

mke21 commented Jan 23, 2025

Nice, now hopefully this will be merged. But alas the project seems to be very dormant, seeing all the open pull requests here.

@stevej2608
Copy link

I've tried this PR with the accompanying demo async_map_view_demo.py and it works fine.

Running the same demo with customtkinter substituted for tkinter fails with no error report.

import customtkinter

...

root_tk = customtkinter.CTk()

...

async_mainloop(root_tk)

The examples/map_with_customtkinter.py demo also fails when using AsyncTkinterMapView.

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

Successfully merging this pull request may close these issues.

3 participants